diff options
author | Quentin Gliech <quentingliech@gmail.com> | 2018-07-22 00:19:38 +0200 |
---|---|---|
committer | Quentin Gliech <quentingliech@gmail.com> | 2018-07-22 00:19:38 +0200 |
commit | 62c422fa96d9751903e8eeb8ff6bccc45eb5995a (patch) | |
tree | 18b982e0e7b143b4f65849a5f80b5f1bd0a27d88 /webui/src/App.js | |
parent | 3dd41e5da17c41d24fe295819b3717e5ae47794d (diff) | |
download | git-bug-62c422fa96d9751903e8eeb8ff6bccc45eb5995a.tar.gz |
Basic WebUI
Based on Material-UI, react-router and react-apollo
Diffstat (limited to 'webui/src/App.js')
-rw-r--r-- | webui/src/App.js | 45 |
1 files changed, 28 insertions, 17 deletions
diff --git a/webui/src/App.js b/webui/src/App.js index 95bd38af..ddab0691 100644 --- a/webui/src/App.js +++ b/webui/src/App.js @@ -1,19 +1,30 @@ -import React, { Component } from 'react' -import './App.css' +import React from "react"; +import { withRouter, Switch, Route } from "react-router"; -class App extends Component { - render() { - return ( - <div className="App"> - <header className="App-header"> - <h1 className="App-title">Git bug</h1> - </header> - <p className="App-intro"> - Here will appear a Web UI ! - </p> - </div> - ); - } -} +import AppBar from "@material-ui/core/AppBar"; +import CssBaseline from "@material-ui/core/CssBaseline"; +import Toolbar from "@material-ui/core/Toolbar"; +import Typography from "@material-ui/core/Typography"; -export default App; +import Bug from "./Bug"; + +const Home = () => <h1>Home</h1>; + +const App = ({ location }) => ( + <React.Fragment> + <CssBaseline /> + <AppBar position="static" color="primary"> + <Toolbar> + <Typography variant="title" color="inherit"> + git-bug-webui(1) + </Typography> + </Toolbar> + </AppBar> + <Switch> + <Route path="/" exact component={Home} /> + <Route path="/bug/:id" exact component={Bug} /> + </Switch> + </React.Fragment> +); + +export default withRouter(App); |