Skip to content

Instantly share code, notes, and snippets.

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}), {})
}), {});
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,
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,