diff --git a/src/components/join-flow/join-flow-step.jsx b/src/components/join-flow/join-flow-step.jsx new file mode 100644 index 000000000..19a180590 --- /dev/null +++ b/src/components/join-flow/join-flow-step.jsx @@ -0,0 +1,40 @@ +const React = require('react'); +const PropTypes = require('prop-types'); +import {Form} from 'formik'; + +const NextStepButton = require('./next-step-button.jsx'); + +const JoinFlowStep = ({ + children, + description, + title, + waiting +}) => ( +
+
+ {title && ( +

+ {title} +

+ )} + {description && ( +

+ + {description} + +

+ )} + {children} +
+ + +); + +JoinFlowStep.propTypes = { + children: PropTypes.node, + description: PropTypes.string, + title: PropTypes.string, + waiting: PropTypes.bool +}; + +module.exports = JoinFlowStep; diff --git a/src/components/join-flow/join-flow.jsx b/src/components/join-flow/join-flow.jsx index 0442afe75..d7acdc214 100644 --- a/src/components/join-flow/join-flow.jsx +++ b/src/components/join-flow/join-flow.jsx @@ -28,7 +28,7 @@ class JoinFlow extends React.Component { render () { return ( - + ); } diff --git a/src/components/join-flow/next-step-button.jsx b/src/components/join-flow/next-step-button.jsx new file mode 100644 index 000000000..d261bc1d0 --- /dev/null +++ b/src/components/join-flow/next-step-button.jsx @@ -0,0 +1,36 @@ +const omit = require('lodash.omit'); +const React = require('react'); +const PropTypes = require('prop-types'); +const injectIntl = require('react-intl').injectIntl; + +const intl = require('../../lib/intl.jsx'); +const Spinner = require('../../components/spinner/spinner.jsx'); + +const NextStepButton = props => ( + +); + +NextStepButton.propTypes = { + intl: intl.intlShape, + text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), + waiting: PropTypes.bool +}; + +NextStepButton.defaultProps = { + waiting: false +}; + +module.exports = injectIntl(NextStepButton); diff --git a/src/components/registration/join-flow-steps.jsx b/src/components/registration/join-flow-steps.jsx index d445b4fad..3804ffa81 100644 --- a/src/components/registration/join-flow-steps.jsx +++ b/src/components/registration/join-flow-steps.jsx @@ -1,7 +1,10 @@ /* eslint-disable react/no-multi-comp */ const React = require('react'); -const injectIntl = require('react-intl').injectIntl; -import {Formik, Form} from 'formik'; +const PropTypes = require('prop-types'); +import {Formik} from 'formik'; +const {injectIntl, intlShape} = require('react-intl'); + +const JoinFlowStep = require('../join-flow/join-flow-step.jsx'); /* * Username step @@ -11,16 +14,22 @@ class UsernameStep extends React.Component { constructor (props) { super(props); } - render () { return ( -
+ ); } @@ -28,11 +37,12 @@ class UsernameStep extends React.Component { /* eslint-enable */ UsernameStep.propTypes = { + intl: intlShape, + waiting: PropTypes.bool }; UsernameStep.defaultProps = { + waiting: false }; -const IntlUsernameStep = injectIntl(UsernameStep); - -module.exports.UsernameStep = IntlUsernameStep; +module.exports.UsernameStep = injectIntl(UsernameStep);