Ensure forms are connected in containers

This commit is contained in:
JUDIT GRESKOVITS 2017-02-09 11:56:34 +00:00
parent 09627b8d86
commit e3b304846d
2 changed files with 13 additions and 11 deletions

View File

@ -1,5 +1,4 @@
const React = require('react'); const React = require('react');
const ReduxForm = require('redux-form');
const ReactIntl = require('react-intl'); const ReactIntl = require('react-intl');
const Styled = require('styled-components'); const Styled = require('styled-components');
@ -9,10 +8,6 @@ const fns = require('@ui/shared/functions');
const Button = require('@ui/components/button'); const Button = require('@ui/components/button');
const Card = require('@ui/components/payment-card'); const Card = require('@ui/components/payment-card');
const {
reduxForm
} = ReduxForm;
const { const {
FormattedMessage FormattedMessage
} = ReactIntl; } = ReactIntl;
@ -120,8 +115,4 @@ NewProjectBilling.propTypes = {
onSubmit: React.PropTypes.func.isRequired onSubmit: React.PropTypes.func.isRequired
}; };
module.exports = reduxForm({ module.exports = NewProjectBilling;
form: 'create-project',
destroyOnUnmount: false,
forceUnregisterOnUnmount: true
})(NewProjectBilling);

View File

@ -1,15 +1,20 @@
const React = require('react'); const React = require('react');
const ReactRedux = require('react-redux'); const ReactRedux = require('react-redux');
const ReduxForm = require('redux-form');
const selectors = require('@state/selectors'); const selectors = require('@state/selectors');
const actions = require('@state/actions'); const actions = require('@state/actions');
const PropTypes = require('@root/prop-types'); const PropTypes = require('@root/prop-types');
const BillingForm = require('@components/new-project/billing'); const NewProjectBilling = require('@components/new-project/billing');
const { const {
connect connect
} = ReactRedux; } = ReactRedux;
const {
reduxForm
} = ReduxForm;
const { const {
orgByIdSelector orgByIdSelector
} = selectors; } = selectors;
@ -18,6 +23,12 @@ const {
handleNewProject handleNewProject
} = actions; } = actions;
const BillingForm = reduxForm({
form: 'create-project',
destroyOnUnmount: false,
forceUnregisterOnUnmount: true
})(NewProjectBilling);
const Billing = (props) => { const Billing = (props) => {
const { const {