diff options
author | Eugene <eug-vs@keemail.me> | 2020-01-12 15:11:05 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-12 15:11:05 +0000 |
commit | d131fe1c40da4faf8fe850994d000263f867c9d6 (patch) | |
tree | c4b8fb31a112ef3fe38b6f02a17d75d722ae3dea /src/index.js | |
parent | 23a5631531861ac76d532c0d9d2b19dd1862f739 (diff) | |
parent | 364c16c467b5257980337a06497647ebc13e4c35 (diff) | |
download | chrono-cube-ui-d131fe1c40da4faf8fe850994d000263f867c9d6.tar.gz |
Merge pull request #33 from Eug-VS/contribute
Contribute section support
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/index.js b/src/index.js index 431e139..0c3d415 100644 --- a/src/index.js +++ b/src/index.js @@ -1,20 +1,15 @@ import React, { useState } from 'react'; import ReactDOM from 'react-dom'; -import { Box } from "@material-ui/core"; import CssBaseline from '@material-ui/core/CssBaseline'; -import { ThemeProvider, makeStyles } from '@material-ui/core/styles'; +import { ThemeProvider } from '@material-ui/core/styles'; +import 'typeface-roboto'; import theme from "./theme"; import Header from './components/Header/Header'; -import TimerPage from "./components/TimerPage/TimerPage"; -import Scoreboard from "./components/Scoreboard/Scoreboard"; - - -const useStyles = makeStyles(theme => ({ - root: { - }, -})); +import Timer from "./pages/Timer/Timer"; +import Scoreboard from "./pages/Scoreboard/Scoreboard"; +import Contribute from "./pages/Contribute/Contribute"; const App = () => { @@ -22,19 +17,23 @@ const App = () => { const [page, setPage] = useState('app'); const [recentSolutions, setRecentSolutions] = useState([]); - const classes = useStyles(); - - const getPageComponent = page => { + const Page = ({ page }) => { switch (page) { case 'app': return ( - <TimerPage + <Timer recentSolutions={recentSolutions} setRecentSolutions={setRecentSolutions} + setPage={setPage} /> ); + case 'scoreboard': - return (<Scoreboard/>); + return (<Scoreboard />); + + case 'contribute': + return (<Contribute />); + default: return ( <p> @@ -49,9 +48,7 @@ const App = () => { <ThemeProvider theme={theme}> <CssBaseline/> <Header page={page} setPage={setPage}/> - <Box className={classes.root}> - { getPageComponent(page) } - </Box> + <Page page={page} /> </ThemeProvider> ); }; |