diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-22 10:06:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-22 10:06:40 +0200 |
commit | e1f597639bfc2f796f74afa87e41581087f0b26e (patch) | |
tree | 4bf2bcb127924ed3265c68bd9beb4baa24def432 /webui/src/BugPage.js | |
parent | 94623b2a82485e573005fc52441dcdbe79f8d026 (diff) | |
parent | 6d8559048f9dcbac4ee9f65de54bda4cd1a7431c (diff) | |
download | git-bug-e1f597639bfc2f796f74afa87e41581087f0b26e.tar.gz |
Merge pull request #3 from MichaelMure/ui
WIP: Web UI
Diffstat (limited to 'webui/src/BugPage.js')
-rw-r--r-- | webui/src/BugPage.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/webui/src/BugPage.js b/webui/src/BugPage.js new file mode 100644 index 00000000..ec0872eb --- /dev/null +++ b/webui/src/BugPage.js @@ -0,0 +1,29 @@ +import React from "react"; +import { Query } from "react-apollo"; +import gql from "graphql-tag"; + +import CircularProgress from "@material-ui/core/CircularProgress"; + +import Bug from "./Bug"; + +const QUERY = gql` + query GetBug($id: BugID!) { + bug(id: $id) { + ...Bug + } + } + + ${Bug.fragment} +`; + +const BugPage = ({ match }) => ( + <Query query={QUERY} variables={{ id: match.params.id }}> + {({ loading, error, data }) => { + if (loading) return <CircularProgress />; + if (error) return <p>Error.</p>; + return <Bug bug={data.bug} />; + }} + </Query> +); + +export default BugPage; |