aboutsummaryrefslogtreecommitdiff
path: root/src/components/Header
diff options
context:
space:
mode:
authorEug-VS <eug-vs@keemail.me>2020-01-06 04:13:25 +0300
committerEug-VS <eug-vs@keemail.me>2020-01-06 04:13:25 +0300
commit16965170fafbe989171448e8086405421723227e (patch)
tree21fecc5a1cc88986be9aa32cce59b7ab7ea23053 /src/components/Header
parent4d3d3ea44eb1ef440c4ba81562f3738ab5e09fd2 (diff)
downloadchrono-cube-ui-16965170fafbe989171448e8086405421723227e.tar.gz
Add icons to Header, replace News -> Contribute
Diffstat (limited to 'src/components/Header')
-rw-r--r--src/components/Header/Header.js29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/components/Header/Header.js b/src/components/Header/Header.js
index 26ba45c..1479636 100644
--- a/src/components/Header/Header.js
+++ b/src/components/Header/Header.js
@@ -1,4 +1,5 @@
import React from "react";
+
import {
AppBar,
Tabs,
@@ -6,16 +7,19 @@ import {
Typography,
Toolbar,
} 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 => ({
logo: {
color: theme.palette.secondary.main,
margin: theme.spacing(0, 2, 0, 3)
},
- tab: {
- padding: theme.spacing(3, 0, 3, 0)
- },
}));
@@ -26,15 +30,26 @@ const Header = ({ page, setPage }) => {
setPage(newPage);
};
- const menuItems = ['app', 'profile', 'scoreboard', 'news'];
+ const icons = {
+ app: (<TimerIcon />),
+ profile: (<AccountCircleIcon />),
+ scoreboard: (<AssignmentIcon />),
+ contribute: (<GitHubIcon />),
+ };
return (
- <AppBar position="sticky" className={classes.header}>
+ <AppBar position="sticky">
<Toolbar>
<Typography variant="h4" className={classes.logo}> ChronoCube </Typography>
<Tabs onChange={handleChange} value={page}>
- { menuItems.map(menuItem => (
- <Tab label={menuItem} value={menuItem} key={menuItem} className={classes.tab}/>
+ { Object.keys(icons).map(item => (
+ <Tab
+ className={classes.tab}
+ label={item}
+ icon={icons[item]}
+ value={item}
+ key={item}
+ />
))}
</Tabs>
</Toolbar>