2017-07-18 15:53:56 +02:00
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* EditForm
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
import { map } from 'lodash';
|
|
|
|
|
import EditFormSection from 'components/EditFormSection';
|
|
|
|
|
import styles from './styles.scss';
|
|
|
|
|
|
|
|
|
|
class EditForm extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div className={styles.editForm}>
|
|
|
|
|
<div className={styles.formContainer}>
|
|
|
|
|
{map(this.props.sections, (section, key) => {
|
|
|
|
|
let line;
|
|
|
|
|
// display hr only if next section
|
|
|
|
|
if (key + 1 < this.props.sections.length) {
|
|
|
|
|
line = <hr />;
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<div key={key}>
|
2017-07-18 17:52:39 +02:00
|
|
|
<EditFormSection section={section} handleChange={this.props.handleChange} />
|
2017-07-18 15:53:56 +02:00
|
|
|
{line}
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
EditForm.propTypes = {
|
|
|
|
|
formData: React.PropTypes.array
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default EditForm;
|