* 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
24 lines
564 B
JavaScript
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;
|