Last active
May 17, 2016 20:09
-
-
Save rewmike/bd9da4020b16d461c5749305f980f758 to your computer and use it in GitHub Desktop.
Common stuff
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 sizePropType from '../propTypes/size'; | |
import sizeClass from '../utils/sizeClass'; | |
const Component = ({ size }) => { | |
let classNames = ''; | |
if (size) classNames += ' ' + sizeClass(size); | |
return <div className={classNames} />; | |
}; | |
Component.propTypes = { | |
size: sizePropType.isRequired | |
}; | |
Component.defaultProps = { | |
size: '4' | |
}; | |
export default Component; |
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 { PropTypes } from 'react'; | |
export default PropTypes.oneOf(['1', '2', '3', '4', '5']); |
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
export default function (size) => 'S' + size; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
*** completely un-tested