App.js

 1import AppBar from '@material-ui/core/AppBar'
 2import CssBaseline from '@material-ui/core/CssBaseline'
 3import { withStyles } from '@material-ui/core/styles'
 4import Toolbar from '@material-ui/core/Toolbar'
 5import Typography from '@material-ui/core/Typography'
 6import React from 'react'
 7import { Route, Switch, withRouter } from 'react-router'
 8import { Link } from 'react-router-dom'
 9
10import BugPage from './bug/BugPage'
11import ListPage from './list/ListPage'
12
13const styles = theme => ({
14  appTitle: {
15    color: 'white',
16    textDecoration: 'none'
17  }
18})
19
20const App = ({location, classes}) => (
21  <React.Fragment>
22    <CssBaseline/>
23    <AppBar position="static" color="primary">
24      <Toolbar>
25        <Link to="/" className={classes.appTitle}>
26          <Typography variant="title" color="inherit">
27            git-bug webui
28          </Typography>
29        </Link>
30      </Toolbar>
31    </AppBar>
32    <Switch>
33      <Route path="/" exact component={ListPage}/>
34      <Route path="/bug/:id" exact component={BugPage}/>
35    </Switch>
36  </React.Fragment>
37)
38
39export default withStyles(styles)(withRouter(App))