aboutsummaryrefslogtreecommitdiffstats
path: root/webui/src/ListPage.js
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-08-14 02:06:02 +0200
committerMichael Muré <batolettre@gmail.com>2018-08-14 02:06:02 +0200
commit5edcb6c8bd430af4c26567d19c388d4c3e30b681 (patch)
treeb47590b6c880f62f0b386e5433aafd010093ab03 /webui/src/ListPage.js
parent4c850b598939536b2e09ed520e427e94d0026211 (diff)
downloadgit-bug-5edcb6c8bd430af4c26567d19c388d4c3e30b681.tar.gz
webui: revamp the bug list
Diffstat (limited to 'webui/src/ListPage.js')
-rw-r--r--webui/src/ListPage.js47
1 files changed, 26 insertions, 21 deletions
diff --git a/webui/src/ListPage.js b/webui/src/ListPage.js
index ed56e553..76350ec5 100644
--- a/webui/src/ListPage.js
+++ b/webui/src/ListPage.js
@@ -1,11 +1,12 @@
-import React from "react";
-import { Query } from "react-apollo";
-import gql from "graphql-tag";
-import { withStyles } from "@material-ui/core/styles";
+import CircularProgress from '@material-ui/core/CircularProgress'
+import { withStyles } from '@material-ui/core/styles'
+import Table from '@material-ui/core/Table/Table'
+import TableBody from '@material-ui/core/TableBody/TableBody'
+import gql from 'graphql-tag'
+import React from 'react'
+import { Query } from 'react-apollo'
-import CircularProgress from "@material-ui/core/CircularProgress";
-
-import BugSummary from "./BugSummary";
+import BugSummary from './BugSummary'
const QUERY = gql`
{
@@ -22,32 +23,36 @@ const QUERY = gql`
}
${BugSummary.fragment}
-`;
+`
const styles = theme => ({
main: {
maxWidth: 600,
- margin: "auto",
+ margin: 'auto',
marginTop: theme.spacing.unit * 4
}
-});
+})
-const List = withStyles(styles)(({ bugs, classes }) => (
+const List = withStyles(styles)(({bugs, classes}) => (
<main className={classes.main}>
- {bugs.edges.map(({ cursor, node }) => (
- <BugSummary bug={node} key={cursor} />
- ))}
+ <Table className={classes.table}>
+ <TableBody>
+ {bugs.edges.map(({ cursor, node }) => (
+ <BugSummary bug={node} key={cursor} />
+ ))}
+ </TableBody>
+ </Table>
</main>
-));
+))
const ListPage = () => (
<Query query={QUERY}>
- {({ loading, error, data }) => {
- if (loading) return <CircularProgress />;
- if (error) return <p>Error.</p>;
- return <List bugs={data.defaultRepository.bugs} />;
+ {({loading, error, data}) => {
+ if (loading) return <CircularProgress/>
+ if (error) return <p>Error.</p>
+ return <List bugs={data.defaultRepository.bugs}/>
}}
</Query>
-);
+)
-export default ListPage;
+export default ListPage