From 8f0a5024a2b062c7ddf8d73f909b39050a624888 Mon Sep 17 00:00:00 2001 From: Eug-VS Date: Mon, 27 Jan 2020 19:48:22 +0300 Subject: feat: make Header more abstract --- src/lib/components/Header/Header.js | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'src/lib/components/Header') diff --git a/src/lib/components/Header/Header.js b/src/lib/components/Header/Header.js index fddf8b3..a055fcb 100644 --- a/src/lib/components/Header/Header.js +++ b/src/lib/components/Header/Header.js @@ -9,20 +9,16 @@ import { } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; -import TimerIcon from '@material-ui/icons/Timer'; -import AccountCircleIcon from '@material-ui/icons/AccountCircle'; -import AssignmentIcon from '@material-ui/icons/Assignment'; -import GitHubIcon from '@material-ui/icons/GitHub'; const useStyles = makeStyles(theme => ({ root: { background: theme.palette.background.elevation2, color: theme.palette.text.primary, + paddingLeft: theme.spacing(3), }, logo: { - margin: theme.spacing(0, 3, 0, 3), - color: theme.palette.primary.main, + margin: theme.spacing(0, 3, 0, 1), }, tab: { '& .MuiTab-wrapper': { @@ -37,31 +33,25 @@ const useStyles = makeStyles(theme => ({ })); -const Header = ({ page, setPage }) => { +const Header = ({ logo, contents, page, setPage }) => { const classes = useStyles(); const handleChange = (event, newPage) => { setPage(newPage); }; - const icons = { - app: (), - profile: (), - scoreboard: (), - contribute: (), - }; - return ( - - ChronoCube - + {logo.icon} + + {logo.title} + - { Object.keys(icons).map(item => ( + {contents && Object.keys(contents).map(item => (