Created
May 18, 2017 19:15
-
-
Save mrcthms/5adecd0802f0c72f9ef567364a286aa7 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 from 'react'; | |
import PropTypes from 'prop-types'; | |
import './Badge.css'; | |
const Badge = ({ withHeading, heading, children }) => ( | |
<div className="badge"> | |
{withHeading && ( | |
<span className="badge-heading">{heading}</span> | |
)} | |
{children} | |
</div> | |
); | |
Badge.propTypes = { | |
withHeading: PropTypes.bool, | |
heading: PropTypes.string, | |
children: PropTypes.node.isRequired | |
}; | |
export default Badge; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment