App.js

 1import AppBar from '@material-ui/core/AppBar';
 2import CssBaseline from '@material-ui/core/CssBaseline';
 3import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';
 4import { makeStyles } from '@material-ui/styles';
 5import Toolbar from '@material-ui/core/Toolbar';
 6import React from 'react';
 7import { Route, Switch } from 'react-router';
 8import { Link } from 'react-router-dom';
 9
10import BugQuery from './bug/BugQuery';
11import ListQuery from './list/ListQuery';
12
13const theme = createMuiTheme({
14  palette: {
15    primary: {
16      main: '#263238',
17    },
18  },
19});
20
21const useStyles = makeStyles(theme => ({
22  appTitle: {
23    ...theme.typography.h6,
24    color: 'white',
25    textDecoration: 'none',
26  },
27}));
28
29export default function App() {
30  const classes = useStyles();
31
32  return (
33    <ThemeProvider theme={theme}>
34      <CssBaseline />
35      <AppBar position="static" color="primary">
36        <Toolbar>
37          <Link to="/" className={classes.appTitle}>
38            git-bug webui
39          </Link>
40        </Toolbar>
41      </AppBar>
42      <Switch>
43        <Route path="/" exact component={ListQuery} />
44        <Route path="/bug/:id" exact component={BugQuery} />
45      </Switch>
46    </ThemeProvider>
47  );
48}