Skip to content

Instantly share code, notes, and snippets.

@fredbegin11
Last active November 1, 2019 21:48
Show Gist options
  • Select an option

  • Save fredbegin11/8e9fffb2d6952ff164fb8c6a7657ce2e to your computer and use it in GitHub Desktop.

Select an option

Save fredbegin11/8e9fffb2d6952ff164fb8c6a7657ce2e to your computer and use it in GitHub Desktop.
import React from 'react';
import PropTypes from 'prop-types';
const Card = ({ description, isWarning, title }) => (
<article className={`card ${isWarning && '--warning'}`}>
<h3 className="card__title">{title}</h3>
<p className="card__description">{description}</p>
</article>
);
Card.propTypes = {
description: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
isWarning: PropTypes.bool
};
Card.defaultProps = {
isWarning: false
};
export default Card;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment