aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/Bug.js
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-07-22 10:06:40 +0200
committerGitHub <noreply@github.com>2018-07-22 10:06:40 +0200
commite1f597639bfc2f796f74afa87e41581087f0b26e (patch)
tree4bf2bcb127924ed3265c68bd9beb4baa24def432 /webui/src/Bug.js
parent94623b2a82485e573005fc52441dcdbe79f8d026 (diff)
parent6d8559048f9dcbac4ee9f65de54bda4cd1a7431c (diff)
downloadgit-bug-e1f597639bfc2f796f74afa87e41581087f0b26e.tar.gz
Merge pull request #3 from MichaelMure/ui
WIP: Web UI
Diffstat (limited to 'webui/src/Bug.js')
-rw-r--r--webui/src/Bug.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/webui/src/Bug.js b/webui/src/Bug.js
new file mode 100644
index 00000000..28558a13
--- /dev/null
+++ b/webui/src/Bug.js
@@ -0,0 +1,38 @@
+import React from "react";
+import gql from "graphql-tag";
+import { withStyles } from "@material-ui/core/styles";
+
+import Comment from "./Comment";
+import BugSummary from "./BugSummary";
+
+const styles = theme => ({
+ main: {
+ maxWidth: 600,
+ margin: "auto",
+ marginTop: theme.spacing.unit * 4
+ }
+});
+
+const Bug = ({ bug, classes }) => (
+ <main className={classes.main}>
+ <BugSummary bug={bug} />
+
+ {bug.comments.map((comment, index) => (
+ <Comment key={index} comment={comment} />
+ ))}
+ </main>
+);
+
+Bug.fragment = gql`
+ fragment Bug on Bug {
+ ...BugSummary
+ comments {
+ ...Comment
+ }
+ }
+
+ ${BugSummary.fragment}
+ ${Comment.fragment}
+`;
+
+export default withStyles(styles)(Bug);