docbrown/app/javascript/article-form/elements/title.jsx
Ben Halpern c7d7d55460
[WIP] Move both v1 and v2 editor to v2 preact-driven editor (#2797)
* Initial work on v2

* Initial changes merger

* Work to finalize v1/v2 editor adjustments

* Clean up styling

* Fiddle with form margins

* Fix some tests

* Change video

* skip a couple tests

* Modify tests to work with new code
2019-05-13 12:27:36 -04:00

24 lines
564 B
JavaScript

import { h } from 'preact';
import PropTypes from 'prop-types';
import Textarea from 'preact-textarea-autosize';
const Title = ({ onChange, defaultValue, onKeyDown }) => (
<Textarea
className="articleform__title"
type="text"
id="article-form-title"
placeholder="Title"
autoComplete="off"
value={defaultValue}
onInput={onChange}
onKeyDown={onKeyDown}
/>
);
Title.propTypes = {
onChange: PropTypes.func.isRequired,
defaultValue: PropTypes.string.isRequired,
onKeyDown: PropTypes.func.isRequired,
};
export default Title;