Created
August 13, 2018 21:38
-
-
Save apps-manager/5858b5783a72384b9ea00c6996117c2e to your computer and use it in GitHub Desktop.
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, | |
id: PropTypes.string, | |
wrapper: PropTypes.func | |
}; | |
render() { | |
const {state, children, className, id, wrapper} = this.props; | |
const row = (<Grid {...{id, className: classnames(className, 'form-row')}}>{children}</Grid>); | |
return wrapper ? React.cloneElement(wrapper(state), {children: row}) : row; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment