blob: f9994d8eee88ac7f2bfd3b51200d9230794f1128 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
import React from 'react';
import PropTypes from 'prop-types';
import { withStyles } from '@material-ui/core/styles';
import { Card, CardMedia, CardActions, CardContent, Button } from '@material-ui/core';
import styles from './cardStyle-jss';
class NewsCard extends React.Component {
render() {
const {
classes,
children,
title,
image,
} = this.props;
return (
<Card className={classes.cardMedia}>
<CardMedia
className={classes.media}
image={image}
title={title}
/>
<CardContent>
{children}
</CardContent>
<CardActions>
<Button size="small" color="primary">
Share
</Button>
<Button size="small" color="primary">
Learn More
</Button>
</CardActions>
</Card>
);
}
}
NewsCard.propTypes = {
classes: PropTypes.object.isRequired,
children: PropTypes.node.isRequired,
title: PropTypes.string.isRequired,
image: PropTypes.string.isRequired,
};
export default withStyles(styles)(NewsCard);
|