Fix Lists edit form
[MAILPOET-1348]
This commit is contained in:
@ -1,17 +1,29 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const FormFieldTextarea = () => (
|
||||
const FormFieldTextarea = props => (
|
||||
<textarea
|
||||
type="text"
|
||||
className="regular-text"
|
||||
name={this.props.field.name}
|
||||
id={`field_${this.props.field.name}`}
|
||||
value={this.props.item[this.props.field.name]}
|
||||
placeholder={this.props.field.placeholder}
|
||||
defaultValue={this.props.field.defaultValue}
|
||||
onChange={this.props.onValueChange}
|
||||
{...this.props.field.validation}
|
||||
name={props.field.name}
|
||||
id={`field_${props.field.name}`}
|
||||
value={props.item[props.field.name]}
|
||||
placeholder={props.field.placeholder}
|
||||
defaultValue={props.field.defaultValue}
|
||||
onChange={props.onValueChange}
|
||||
{...props.field.validation}
|
||||
/>
|
||||
);
|
||||
|
||||
FormFieldTextarea.propTypes = {
|
||||
item: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||
field: PropTypes.shape({
|
||||
name: PropTypes.string,
|
||||
placeholder: PropTypes.string,
|
||||
defaultValue: PropTypes.string,
|
||||
validation: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||
}).isRequired,
|
||||
onValueChange: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
export default FormFieldTextarea;
|
||||
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { Link } from 'react-router';
|
||||
import MailPoet from 'mailpoet';
|
||||
import Form from 'form/form.jsx';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const fields = [
|
||||
{
|
||||
@ -29,7 +30,7 @@ const messages = {
|
||||
},
|
||||
};
|
||||
|
||||
const SegmentForm = params => (
|
||||
const SegmentForm = ({ params }) => (
|
||||
<div>
|
||||
<h1 className="title">
|
||||
{MailPoet.I18n.t('segment')}
|
||||
@ -45,4 +46,10 @@ const SegmentForm = params => (
|
||||
</div>
|
||||
);
|
||||
|
||||
SegmentForm.propTypes = {
|
||||
params: PropTypes.shape({
|
||||
id: PropTypes.string,
|
||||
}).isRequired,
|
||||
};
|
||||
|
||||
export default SegmentForm;
|
||||
|
Reference in New Issue
Block a user