Last active
August 3, 2017 19:13
-
-
Save mnicole/c04c106a3fb49d542bb366601828611d to your computer and use it in GitHub Desktop.
Badge 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 React, { PropTypes } from ‘react’; | |
const Badge = ({ text, context, className, style, ...otherProps }) => { | |
const classes = `${context} ${className}`; | |
return ( | |
<span className={ classes } style={ style } { ...otherProps }>{ text }</span> | |
); | |
}; | |
Badge.defaultProps = { | |
text: ‘’, | |
context: ‘default’, | |
className: ‘’, | |
style: {} | |
}; | |
Badge.propTypes = { | |
text: PropTypes.string, | |
context: PropTypes.string, | |
className: PropTypes.string, | |
style: PropTypes.object | |
}; | |
export default Badge; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment