App.js

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