* Add myself to core contributors * add myself to the core contributors * implement autosave in sessionStorage * clear sessionstorage on save * add new changes flag * add clear button and css for it * add clear button functionality * make clear session storage only run if save is successful * update jest snapshot for autosave * add a few tests * add a few tests * add test for clear button * make autosave work for title, tags, and cover image * remove console.log * make clear button into a message instead * move to button with no styling instead of span * remove warning on refresh * remove warning on refresh * move to localstorage so that persists across tabs * fix blip on change from HTML to JSX * make confirm work properly * fix css jump for v2 editor * fix v2 editor height jump * remove unused onKeyUp prop * indent _v2_form.html.erb file * indent v2 editor erb * Update package.json with missing package
20 lines
446 B
JavaScript
20 lines
446 B
JavaScript
import { h } from 'preact';
|
|
import PropTypes from 'prop-types';
|
|
|
|
const BodyMarkdown = ({ onChange, defaultValue }) => (
|
|
<textarea
|
|
className="articleform__body"
|
|
id="article_body_markdown"
|
|
placeholder="Body"
|
|
value={defaultValue}
|
|
onInput={onChange}
|
|
name="body_markdown"
|
|
/>
|
|
);
|
|
|
|
BodyMarkdown.propTypes = {
|
|
onChange: PropTypes.func.isRequired,
|
|
defaultValue: PropTypes.string.isRequired,
|
|
};
|
|
|
|
export default BodyMarkdown;
|