Skip to content

Instantly share code, notes, and snippets.

@mrcthms
Created May 18, 2017 19:15
Show Gist options
  • Save mrcthms/5adecd0802f0c72f9ef567364a286aa7 to your computer and use it in GitHub Desktop.
Save mrcthms/5adecd0802f0c72f9ef567364a286aa7 to your computer and use it in GitHub Desktop.
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