2016-06-03 11:03:36 +09:00
|
|
|
import React, { PropTypes, Component } from 'react';
|
|
|
|
import FormComponent from "./FormComponent.jsx";
|
|
|
|
|
|
|
|
class FormGroup extends Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="form-section">
|
|
|
|
{this.props.name === "default" ? null : <h3 className="form-section-heading">{this.props.label}</h3>}
|
2017-01-23 15:50:55 +01:00
|
|
|
{this.props.fields.map(field => <FormComponent key={field.name} {...field} updateCurrentValues={this.props.updateCurrentValues} />)}
|
2016-06-03 11:03:36 +09:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
FormGroup.propTypes = {
|
|
|
|
name: React.PropTypes.string,
|
|
|
|
label: React.PropTypes.string,
|
|
|
|
order: React.PropTypes.number,
|
|
|
|
fields: React.PropTypes.array,
|
2017-01-23 15:50:55 +01:00
|
|
|
updateCurrentValues: React.PropTypes.func
|
2016-06-03 11:03:36 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
export default FormGroup;
|