aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/bug/Bug.js
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-15 15:50:19 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-15 15:50:19 +0200
commit2530cee1eac225924e1119554cf475cdc46ed7dc (patch)
tree4d36ca529a2e25a3fe9f1a881d037215184ec9a1 /webui/src/bug/Bug.js
parent24d862a65c603de4ea77a2688f5c90effc65be2f (diff)
downloadgit-bug-2530cee1eac225924e1119554cf475cdc46ed7dc.tar.gz
webui: reorganize the code
Diffstat (limited to 'webui/src/bug/Bug.js')
-rw-r--r--webui/src/bug/Bug.js39
1 files changed, 39 insertions, 0 deletions
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}) => (
+ <main className={classes.main}>
+
+ {bug.comments.edges.map(({cursor, node}) => (
+ <Comment key={cursor} comment={node}/>
+ ))}
+ </main>
+)
+
+Bug.fragment = gql`
+ fragment Bug on Bug {
+ comments(first: 10) {
+ edges {
+ cursor
+ node {
+ ...Comment
+ }
+ }
+ }
+ }
+
+ ${Comment.fragment}
+`
+
+export default withStyles(styles)(Bug)