diff options
author | Eug-VS <eug-vs@keemail.me> | 2020-01-11 17:56:38 +0300 |
---|---|---|
committer | Eug-VS <eug-vs@keemail.me> | 2020-01-11 17:58:19 +0300 |
commit | b2fe1b816044b8630f570c04c884c8ffcf3e3e61 (patch) | |
tree | d2a33cea442a05e626fc74e05f29b8e3c7f94bdc /src/index.js | |
parent | d517398707f74c670d47ed0a277ba328e531579e (diff) | |
download | chrono-cube-ui-b2fe1b816044b8630f570c04c884c8ffcf3e3e61.tar.gz |
Improve names, getPageComponent() --> <Page />
Remove 'Page' word from page-components, since they are all
now located in the pages/ folder.
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/index.js b/src/index.js index 3ec39c3..b14708e 100644 --- a/src/index.js +++ b/src/index.js @@ -6,7 +6,7 @@ import { ThemeProvider } from '@material-ui/core/styles'; import theme from "./theme"; import Header from './components/Header/Header'; -import TimerPage from "./pages/TimerPage/TimerPage"; +import Timer from "./pages/Timer/Timer"; import Scoreboard from "./pages/Scoreboard/Scoreboard"; @@ -15,11 +15,11 @@ const App = () => { const [page, setPage] = useState('app'); const [recentSolutions, setRecentSolutions] = useState([]); - const getPageComponent = page => { + const Page = ({ page }) => { switch (page) { case 'app': return ( - <TimerPage + <Timer recentSolutions={recentSolutions} setRecentSolutions={setRecentSolutions} /> @@ -40,7 +40,7 @@ const App = () => { <ThemeProvider theme={theme}> <CssBaseline/> <Header page={page} setPage={setPage}/> - { getPageComponent(page) } + <Page page={page} /> </ThemeProvider> ); }; |