diff --git a/frontend/src/component/feature/form-add-component.jsx b/frontend/src/component/feature/form-add-component.jsx new file mode 100644 index 0000000000..eae7c93c72 --- /dev/null +++ b/frontend/src/component/feature/form-add-component.jsx @@ -0,0 +1,18 @@ +import React, { PropTypes } from 'react'; +import { Card, CardTitle } from 'react-mdl'; + +import FormComponent from './form'; +import { styles as commonStyles } from '../common'; + +const FormAddComponent = ({ title, ...formProps }) => ( + + {title} + + +); + +FormAddComponent.propTypes = { + title: PropTypes.string, +}; + +export default FormAddComponent; diff --git a/frontend/src/component/feature/form-add-container.jsx b/frontend/src/component/feature/form-add-container.jsx index b8fa7fe06f..b299c2e2b7 100644 --- a/frontend/src/component/feature/form-add-container.jsx +++ b/frontend/src/component/feature/form-add-container.jsx @@ -2,7 +2,7 @@ import { connect } from 'react-redux'; import { hashHistory } from 'react-router'; import { createFeatureToggles, validateName } from '../../store/feature-actions'; import { createMapper, createActions } from '../input-helpers'; -import FormComponent from './form'; +import FormAddComponent from './form-add-component'; const ID = 'add-feature-toggle'; const mapStateToProps = createMapper({ @@ -66,4 +66,9 @@ const prepare = (methods, dispatch) => { }; const actions = createActions({ id: ID, prepare }); -export default connect(mapStateToProps, actions)(FormComponent); +const FormAddContainer = connect( + mapStateToProps, + actions +)(FormAddComponent); + +export default FormAddContainer; diff --git a/frontend/src/component/feature/form/index.jsx b/frontend/src/component/feature/form/index.jsx index acb006a7e7..11720b050d 100644 --- a/frontend/src/component/feature/form/index.jsx +++ b/frontend/src/component/feature/form/index.jsx @@ -1,8 +1,8 @@ import React, { Component, PropTypes } from 'react'; -import { Textfield, Switch, Grid, Cell } from 'react-mdl'; +import { Textfield, Switch } from 'react-mdl'; import StrategiesSection from './strategies-section-container'; -import { FormButtons, HeaderTitle } from '../../common'; +import { FormButtons } from '../../common'; const trim = (value) => { if (value && value.trim) { @@ -33,7 +33,6 @@ class AddFeatureToggleComponent extends Component { onSubmit, onCancel, editmode = false, - title, } = this.props; const { @@ -45,57 +44,52 @@ class AddFeatureToggleComponent extends Component { const configuredStrategies = input.strategies || []; return ( - - -
- {title && } -
- validateName(v.target.value)} - onChange={(v) => setValue('name', trim(v.target.value))} /> -
- setValue('description', v.target.value)} /> - - {!editmode &&
-
- { - setValue('enabled', !enabled); - }}>Enabled -
-
} -
- - + +
+ validateName(v.target.value)} + onChange={(v) => setValue('name', trim(v.target.value))} /> +
+ setValue('description', v.target.value)} /> + {!editmode &&

- - - - + { + setValue('enabled', !enabled); + }}>Enabled +
+
} + + + +
+ +
+ ); }