diff --git a/app/gabsocial/features/forms/index.js b/app/gabsocial/features/forms/index.js index 7cb91cc36..fed8deb8e 100644 --- a/app/gabsocial/features/forms/index.js +++ b/app/gabsocial/features/forms/index.js @@ -79,18 +79,32 @@ export class SimpleInput extends ImmutablePureComponent { } -export const SimpleForm = ({ children, ...props }) => ( -
-); +export class SimpleForm extends ImmutablePureComponent { -SimpleForm.propTypes = { - children: PropTypes.node, -}; + static propTypes = { + children: PropTypes.node, + }; -SimpleForm.defaultProps = { - acceptCharset: 'UTF-8', - onSubmit: e => e.preventDefault(), -}; + static defaultProps = { + acceptCharset: 'UTF-8', + onSubmit: e => {}, + }; + + onSubmit = e => { + this.props.onSubmit(e); + e.preventDefault(); + } + + render() { + const { children, onSubmit, ...props } = this.props; + return ( + + ); + } + +} export const FieldsGroup = ({ children }) => (