diff options
author | Quentin Gliech <quentingliech@gmail.com> | 2018-07-22 00:42:19 +0200 |
---|---|---|
committer | Quentin Gliech <quentingliech@gmail.com> | 2018-07-22 00:42:19 +0200 |
commit | 4901bdadd3918833fc2cf0ad47d73aeeb061af0d (patch) | |
tree | 2f5ae5a753286295fe07120050ef7625d194dd57 /webui/src/Comment.js | |
parent | 62c422fa96d9751903e8eeb8ff6bccc45eb5995a (diff) | |
download | git-bug-4901bdadd3918833fc2cf0ad47d73aeeb061af0d.tar.gz |
webui: Split into multiple, smaller components
Diffstat (limited to 'webui/src/Comment.js')
-rw-r--r-- | webui/src/Comment.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/webui/src/Comment.js b/webui/src/Comment.js new file mode 100644 index 00000000..a4fd1b40 --- /dev/null +++ b/webui/src/Comment.js @@ -0,0 +1,44 @@ +import React from "react"; +import gql from "graphql-tag"; +import { withStyles } from "@material-ui/core/styles"; + +import Avatar from "@material-ui/core/Avatar"; +import Card from "@material-ui/core/Card"; +import CardContent from "@material-ui/core/CardContent"; +import CardHeader from "@material-ui/core/CardHeader"; +import Typography from "@material-ui/core/Typography"; + +const styles = theme => ({ + comment: { + marginBottom: theme.spacing.unit + } +}); + +const Comment = withStyles(styles)(({ comment, classes }) => ( + <Card className={classes.comment}> + <CardHeader + avatar={ + <Avatar aria-label={comment.author.name}> + {comment.author.name[0].toUpperCase()} + </Avatar> + } + title={comment.author.name} + subheader={comment.author.email} + /> + <CardContent> + <Typography component="p">{comment.message}</Typography> + </CardContent> + </Card> +)); + +Comment.fragment = gql` + fragment Comment on Comment { + message + author { + name + email + } + } +`; + +export default withStyles(styles)(Comment); |