docbrown/app/javascript/listings/components/Title.jsx
Robin Gagnon 2c10fb0417
[deploy] fix: Clear chat input after Enter key submit (#10487)
* fix: Clear chat input after Enter key submit

* fix: Rename Composer component

* test: Add integration tests for input value

* After pressing Enter
* After clicking Send
* After clicking Save edit
* After clicking Close edit
2020-10-08 14:51:36 -04:00

31 lines
678 B
JavaScript

import PropTypes from 'prop-types';
import { h } from 'preact';
const domId = 1;
const Title = ({ onChange, defaultValue }) => (
<div className="crayons-field">
<label className="crayons-field__label" htmlFor={domId}>
Title
</label>
<input
type="text"
className="crayons-textfield"
id={domId}
name="listing[title]"
maxLength="128"
size="128"
placeholder="128 characters max, plain text"
autoComplete="off"
value={defaultValue}
onInput={onChange}
/>
</div>
);
Title.propTypes = {
onChange: PropTypes.func.isRequired,
defaultValue: PropTypes.string.isRequired,
};
export default Title;