+
+
+interface RichEditorTextFieldData {
+ label?: string;
+}
+
+type RichEditorTextFieldProps = RichEditorTextFieldData & TextFieldProps;
+
+export const RichEditorTextField = withStyles(styles)(
+ class RichEditorTextField extends React.Component<RichEditorTextFieldProps> {
+ state = {
+ value: RichTextEditor.createValueFromString(this.props.input.value, 'html')
+ };
+
+ onChange = (value: any) => {
+ this.setState({ value });
+ this.props.input.onChange(value.toString('html'));
+ }
+
+ render() {
+ return <RichTextEditor
+ className={this.props.classes.rte}
+ value={this.state.value}
+ onChange={this.onChange}
+ placeholder={this.props.label} />;
+ }
+ }
+);
+
+export const DateTextField = withStyles(styles)
+ ((props: TextFieldProps) =>
+ <MaterialTextField
+ type="date"
+ disabled={props.meta.submitting}
+ helperText={props.meta.error}
+ error={!!props.meta.error}
+ fullWidth={true}
+ InputLabelProps={{
+ shrink: true
+ }}
+ name={props.input.name}
+ onChange={props.input.onChange}
+ value={props.input.value}
+ />
+ );