aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ReviewCard/ReviewCard.tsx43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/components/ReviewCard/ReviewCard.tsx b/src/components/ReviewCard/ReviewCard.tsx
new file mode 100644
index 0000000..9c3dd20
--- /dev/null
+++ b/src/components/ReviewCard/ReviewCard.tsx
@@ -0,0 +1,43 @@
+import React from 'react';
+import { makeStyles } from '@material-ui/core/styles';
+import {
+ Card,
+ CardContent,
+ Typography,
+ Divider
+} from '@material-ui/core/';
+import { Rating } from '@material-ui/lab'
+import { Feedback } from 'which-types';
+
+import UserStrip from '../UserStrip/UserStrip';
+
+interface PropTypes {
+ feedback: Feedback;
+}
+
+const useStyles = makeStyles(theme => ({
+ root: {
+ margin: theme.spacing(4, 0, 1, 0)
+ }
+}));
+
+const ReviewCard: React.FC<PropTypes> = ({ feedback }) => {
+ const classes = useStyles();
+
+ return (
+ <Card className={classes.root} elevation={2}>
+ <UserStrip
+ user={feedback.author}
+ info={<Rating value={feedback.score} readOnly size="small" />}
+ />
+ <Divider />
+ <CardContent>
+ <Typography>
+ {feedback.contents}
+ </Typography>
+ </CardContent>
+ </Card>
+ );
+};
+
+export default ReviewCard;