1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
import React from "react";
import {
AppBar,
Tabs,
Tab,
Typography
} from "@material-ui/core";
import styled from 'styled-components';
import { makeStyles } from '@material-ui/core/styles';
const useStyles = makeStyles(theme => ({
header: {
backgroundColor: theme.palette.primary.dark,
},
logo: {
color: theme.palette.orange.main,
margin: theme.spacing(2, 3, 2, 2)
},
}));
const Header = ({ setPage }) => {
const classes = useStyles();
const handleChange = (event, newPage) => {
setPage(newPage);
};
const menuItems = ['app', 'profile', 'scoreboard', 'news'];
return (
<AppBar position="sticky" className={classes.header}>
<Tabs onChange={handleChange}>
<Typography variant="h4" className={classes.logo}> ChronoCube </Typography>
{ menuItems.map(menuItem => (
<Tab label={menuItem} value={menuItem}/>
))}
</Tabs>
</AppBar>
);
};
export default Header;
|