View GridForm.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import {Form} from 'pivotal-ui/react/forms'; | |
const hasName = col => col && col.props && col.props.name; | |
const getFields = children => React.Children.toArray(children).filter(Boolean).reduce((memo, {props: {children}}) => ({ | |
...memo, | |
...React.Children.toArray(children).filter(hasName).reduce((memo, {props}) => ({...memo, [props.name]: props}), {}) | |
}), {}); |
View FormRow.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import {Grid} from 'pivotal-ui/react/flex-grids'; | |
import classnames from 'classnames'; | |
export class FormRow extends React.Component { | |
static propTypes = { | |
state: PropTypes.object, | |
children: PropTypes.node, | |
className: PropTypes.string, |
View FormCol.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import {FlexCol} from 'pivotal-ui/react/flex-grids'; | |
import {FormUnit} from 'pivotal-ui/react/forms'; | |
import classnames from 'classnames'; | |
export class FormCol extends React.Component { | |
static propTypes = { | |
state: PropTypes.object, | |
canSubmit: PropTypes.func, |