-
-
Save audacioustux/3d0ebfe2d38afe5624404811b2107b3b to your computer and use it in GitHub Desktop.
This file contains hidden or 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, { Component } from 'react'; | |
| import PropTypes from 'prop-types'; | |
| class Flex extends Component { | |
| render() { | |
| const { | |
| children, | |
| element, | |
| // display, | |
| // colBase, | |
| // justifyContent, | |
| // wrap, | |
| // reverse, | |
| // column | |
| } = this.props; | |
| return ( | |
| <{element}>{ children }</{element}> | |
| ); | |
| } | |
| } | |
| Flex.propTypes = { | |
| display: PropTypes.oneOf(['flex', 'inline-flex']), | |
| element: PropTypes.oneOf([ | |
| 'article', | |
| 'aside', | |
| 'div', | |
| 'figure', | |
| 'footer', | |
| 'header', | |
| 'main', | |
| 'nav', | |
| 'section', | |
| ]), | |
| gap: PropTypes.number, | |
| colBase: PropTypes.number, | |
| justifyContent: PropTypes.oneOf( | |
| [ | |
| 'flex-start', | |
| 'flex-end', | |
| 'center', | |
| 'space-between', | |
| 'space-around', | |
| 'initial', | |
| 'inherit' | |
| ] | |
| ), | |
| wrap: PropTypes.bool, | |
| reverse: PropTypes.bool, | |
| column: PropTypes.bool | |
| }; | |
| Flex.defaultProps = { | |
| display: 'flex', | |
| element: 'div', | |
| }; | |
| export default Flex; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment