diff --git a/src/components/Form/Form.js b/src/components/Form/Form.js new file mode 100644 index 00000000..ed4d36a9 --- /dev/null +++ b/src/components/Form/Form.js @@ -0,0 +1,33 @@ +import React, { PropTypes } from 'react'; + +const Form = props => { + const { children, ...restProps } = props; + + const formProps = { + // These are mainly default values for the server + // rendering. Otherwise the form would submit potentially + // sensitive data with the default GET method until the client + // side code is loaded. + method: 'post', + action: '/', + + ...restProps, + }; + return ( +
+ {children} +
+ ); +}; + +Form.defaultProps = { + children: null, +}; + +const { node } = PropTypes; + +Form.propTypes = { + children: node, +}; + +export default Form; diff --git a/src/components/index.js b/src/components/index.js index 245376d5..527152d1 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -15,6 +15,7 @@ import EditListingWizard from './EditListingWizard/EditListingWizard'; import ExpandingTextarea from './ExpandingTextarea/ExpandingTextarea'; import ExternalLink from './ExternalLink/ExternalLink'; import FilterPanel from './FilterPanel/FilterPanel'; +import Form from './Form/Form'; import HeroSection from './HeroSection/HeroSection'; import IconBannedUser from './IconBannedUser/IconBannedUser'; import IconCheckmark from './IconCheckmark/IconCheckmark'; @@ -96,6 +97,7 @@ export { ExpandingTextarea, ExternalLink, FilterPanel, + Form, HeroSection, IconBannedUser, IconCheckmark,