diff options
-rw-r--r-- | src/components/Header/Header.js | 4 | ||||
-rw-r--r-- | src/index.js | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js index 1c4e77d..021f2b4 100644 --- a/src/components/Header/Header.js +++ b/src/components/Header/Header.js @@ -18,7 +18,7 @@ const useStyles = makeStyles(theme => ({ })); -const Header = ({ setPage }) => { +const Header = ({ page, setPage }) => { const classes = useStyles(); const handleChange = (event, newPage) => { @@ -29,7 +29,7 @@ const Header = ({ setPage }) => { return ( <AppBar position="sticky" className={classes.header}> - <Tabs onChange={handleChange}> + <Tabs onChange={handleChange} value={page}> <Typography variant="h4" className={classes.logo}> ChronoCube </Typography> { menuItems.map(menuItem => ( <Tab label={menuItem} value={menuItem}/> diff --git a/src/index.js b/src/index.js index e88b342..5268b1e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,7 @@ import React, { useState } from 'react'; import ReactDOM from 'react-dom'; -import { - Typography, - Box, -} from "@material-ui/core"; +import { Box } from "@material-ui/core"; import CssBaseline from '@material-ui/core/CssBaseline'; import { ThemeProvider, makeStyles } from '@material-ui/core/styles'; @@ -46,7 +43,7 @@ const App = () => { return ( <ThemeProvider theme={theme}> <CssBaseline/> - <Header setPage={setPage}/> + <Header page={page} setPage={setPage}/> <Box className={classes.root}> { getPageComponent(page) } </Box> |