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 | |
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')
-rw-r--r-- | src/index.js | 8 | ||||
-rw-r--r-- | src/pages/Timer/Timer.js (renamed from src/pages/TimerPage/TimerPage.js) | 8 | ||||
-rw-r--r-- | src/pages/Timer/TimerButton/TimerButton.js (renamed from src/pages/TimerPage/Timer/Timer.js) | 4 |
3 files changed, 10 insertions, 10 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> ); }; diff --git a/src/pages/TimerPage/TimerPage.js b/src/pages/Timer/Timer.js index 591eb7b..4b5925f 100644 --- a/src/pages/TimerPage/TimerPage.js +++ b/src/pages/Timer/Timer.js @@ -4,7 +4,7 @@ import { post } from '../../requests'; import Window from "../../components/Window/Window"; import ContentSection from "../../components/ContentSection/ContentSection"; -import Timer from "./Timer/Timer"; +import TimerButton from "./TimerButton/TimerButton"; import SmartList from "../../components/SmartList/SmartList"; import SolutionCard from "../../components/SolutionCard/SolutionCard"; @@ -20,7 +20,7 @@ const useStyles = makeStyles(theme => ({ }, })); -const TimerPage = ({ recentSolutions, setRecentSolutions }) => { +const Timer = ({ recentSolutions, setRecentSolutions }) => { const classes = useStyles(); const user = { @@ -58,7 +58,7 @@ const TimerPage = ({ recentSolutions, setRecentSolutions }) => { and how to make it better! </Typography> </ContentSection> - <Timer registerResult={registerResult} /> + <TimerButton registerResult={registerResult} /> </div> </Window> <Window type="secondary" name="Recent solutions"> @@ -73,4 +73,4 @@ const TimerPage = ({ recentSolutions, setRecentSolutions }) => { }; -export default TimerPage; +export default Timer; diff --git a/src/pages/TimerPage/Timer/Timer.js b/src/pages/Timer/TimerButton/TimerButton.js index 92b153d..56d3084 100644 --- a/src/pages/TimerPage/Timer/Timer.js +++ b/src/pages/Timer/TimerButton/TimerButton.js @@ -12,7 +12,7 @@ const useStyles = makeStyles(theme => ({ }, })); -const Timer = ({ registerResult }) => { +const TimerButton = ({ registerResult }) => { const classes = useStyles(); const SPACE = 32; @@ -116,4 +116,4 @@ const convertTimeToString = timeDelta => { }; -export default Timer; +export default TimerButton; |