rspec/frontend/src/App.tsx

37 lines
793 B
TypeScript
Raw Normal View History

2020-06-25 14:00:11 +02:00
import React from 'react';
2020-07-09 14:26:53 +02:00
import CssBaseline from '@material-ui/core/CssBaseline';
import { Box } from '@material-ui/core';
import useStyles from './App.style';
import {
2020-06-30 14:29:00 +02:00
HashRouter as Router,
Switch,
Route
} from "react-router-dom";
import {RulePage} from "./RulePage";
import {SearchPage} from "./SearchPage";
import TopBar from "./TopBar";
2020-06-25 14:00:11 +02:00
2020-07-09 14:26:53 +02:00
2020-06-25 14:00:11 +02:00
function App() {
2020-07-09 14:26:53 +02:00
const classes = useStyles();
2020-06-25 14:00:11 +02:00
return (
2020-07-09 14:26:53 +02:00
<CssBaseline>
<div className={classes.root}>
<TopBar/>
2020-07-09 14:26:53 +02:00
<Box>
<Router basename="/rspec">
<Switch>
<Route path="/:ruleid/:language?" component={RulePage} />
2020-07-09 14:26:53 +02:00
<Route>
<SearchPage/>
</Route>
</Switch>
</Router>
</Box>
2020-06-25 14:00:11 +02:00
</div>
2020-07-09 14:26:53 +02:00
</CssBaseline>
2020-06-25 14:00:11 +02:00
);
}
export default App;