From 2530cee1eac225924e1119554cf475cdc46ed7dc Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Wed, 15 Aug 2018 15:50:19 +0200 Subject: webui: reorganize the code --- webui/src/bug/Bug.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 webui/src/bug/Bug.js (limited to 'webui/src/bug/Bug.js') diff --git a/webui/src/bug/Bug.js b/webui/src/bug/Bug.js new file mode 100644 index 00000000..33ecdd79 --- /dev/null +++ b/webui/src/bug/Bug.js @@ -0,0 +1,39 @@ +import { withStyles } from '@material-ui/core/styles' +import gql from 'graphql-tag' +import React from 'react' + +import Comment from './Comment' + +const styles = theme => ({ + main: { + maxWidth: 600, + margin: 'auto', + marginTop: theme.spacing.unit * 4 + } +}) + +const Bug = ({bug, classes}) => ( +
+ + {bug.comments.edges.map(({cursor, node}) => ( + + ))} +
+) + +Bug.fragment = gql` + fragment Bug on Bug { + comments(first: 10) { + edges { + cursor + node { + ...Comment + } + } + } + } + + ${Comment.fragment} +` + +export default withStyles(styles)(Bug) -- cgit