diff options
author | Quentin Gliech <quentingliech@gmail.com> | 2019-04-10 21:19:45 +0200 |
---|---|---|
committer | Quentin Gliech <quentingliech@gmail.com> | 2019-05-22 19:52:01 +0200 |
commit | d79ef7a7945ba82caeec62cad44dad134c9edfbc (patch) | |
tree | 392d9ceaead2a5780862ecf89cf1cc2a0c550ed7 /webui/src/App.js | |
parent | 1a7ccd594adc6f185115ce12a4368c55ff418678 (diff) | |
download | git-bug-d79ef7a7945ba82caeec62cad44dad134c9edfbc.tar.gz |
webui: Migrate to Material-UI's new style API
Diffstat (limited to 'webui/src/App.js')
-rw-r--r-- | webui/src/App.js | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/webui/src/App.js b/webui/src/App.js index 3a693dcb..b2eb6bf0 100644 --- a/webui/src/App.js +++ b/webui/src/App.js @@ -1,39 +1,39 @@ import AppBar from '@material-ui/core/AppBar'; import CssBaseline from '@material-ui/core/CssBaseline'; -import { withStyles } from '@material-ui/core/styles'; +import { makeStyles } from '@material-ui/styles'; import Toolbar from '@material-ui/core/Toolbar'; -import Typography from '@material-ui/core/Typography'; import React from 'react'; -import { Route, Switch, withRouter } from 'react-router'; +import { Route, Switch } from 'react-router'; import { Link } from 'react-router-dom'; import BugQuery from './bug/BugQuery'; import ListQuery from './list/ListQuery'; -const styles = theme => ({ +const useStyles = makeStyles(theme => ({ appTitle: { + ...theme.typography.title, color: 'white', textDecoration: 'none', }, -}); +})); -const App = ({ location, classes }) => ( - <React.Fragment> - <CssBaseline /> - <AppBar position="static" color="primary"> - <Toolbar> - <Link to="/" className={classes.appTitle}> - <Typography variant="title" color="inherit"> - git-bug webui - </Typography> - </Link> - </Toolbar> - </AppBar> - <Switch> - <Route path="/" exact component={ListQuery} /> - <Route path="/bug/:id" exact component={BugQuery} /> - </Switch> - </React.Fragment> -); +export default function App() { + const classes = useStyles(); -export default withStyles(styles)(withRouter(App)); + return ( + <> + <CssBaseline /> + <AppBar position="static" color="primary"> + <Toolbar> + <Link to="/" className={classes.appTitle}> + git-bug webui + </Link> + </Toolbar> + </AppBar> + <Switch> + <Route path="/" exact component={ListQuery} /> + <Route path="/bug/:id" exact component={BugQuery} /> + </Switch> + </> + ); +} |