23 lines
429 B
JavaScript
Raw Normal View History

2016-07-12 17:03:39 -03:00
import React, { PropTypes } from 'react';
import { Card } from '../UI';
export default function ImageCard({ onClick, image, text }) {
return (
<Card onClick={onClick}>
<img src={image} />
<h1>{text}</h1>
</Card>
);
}
ImageCard.propTypes = {
image: PropTypes.string.isRequired,
onClick: PropTypes.func,
text: PropTypes.string.isRequired
};
ImageCard.defaultProps = {
onClick: function() {},
};