docbrown/app/javascript/listings/components/Title.jsx
ludwiczakpawel 90d04a73db
Crayonsification of Listings form (#10429)
* i dont know how to test

* fix i guess

* layout update

* layout updates

* edit

* edit listing

* fix

* tags field

* specs|

* Update app/javascript/listings/__tests__/ContactViaConnect.test.jsx

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>

Co-authored-by: Fernando Valverde <fernando@visualcosita.com>
2020-09-30 09:14:48 +02:00

29 lines
666 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;