import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import FormComponent from './FormComponent.jsx'; import { Components } from 'meteor/vulcan:core'; import classNames from 'classnames'; class FormGroup extends PureComponent { constructor(props) { super(props); this.toggle = this.toggle.bind(this); this.renderHeading = this.renderHeading.bind(this); this.state = { collapsed: props.startCollapsed || false } } toggle() { this.setState({ collapsed: !this.state.collapsed }) } renderHeading() { return (

{this.props.label}

{this.state.collapsed ? : }
) } render() { return (
{this.props.name === 'default' ? null : this.renderHeading()}
{this.props.fields.map(field => )}
) } } FormGroup.propTypes = { name: PropTypes.string, label: PropTypes.string, order: PropTypes.number, fields: PropTypes.array, updateCurrentValues: PropTypes.func } export default FormGroup;