diff options
Diffstat (limited to 'webui/src/bug/BugPage.js')
-rw-r--r-- | webui/src/bug/BugPage.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/webui/src/bug/BugPage.js b/webui/src/bug/BugPage.js new file mode 100644 index 00000000..a91030ab --- /dev/null +++ b/webui/src/bug/BugPage.js @@ -0,0 +1,30 @@ +import CircularProgress from '@material-ui/core/CircularProgress' +import gql from 'graphql-tag' +import React from 'react' +import { Query } from 'react-apollo' + +import Bug from './Bug' + +const QUERY = gql` + query GetBug($id: String!) { + defaultRepository { + bug(prefix: $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.defaultRepository.bug}/> + }} + </Query> +) + +export default BugPage |