aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Header/Header.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Header/Header.tsx')
-rw-r--r--src/lib/Header/Header.tsx22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/lib/Header/Header.tsx b/src/lib/Header/Header.tsx
index cc73fd9..e052f6c 100644
--- a/src/lib/Header/Header.tsx
+++ b/src/lib/Header/Header.tsx
@@ -10,6 +10,7 @@ import {
import { makeStyles } from '@material-ui/core/styles';
+
interface PropTypes {
logo: {
icon: React.ReactNode;
@@ -48,19 +49,6 @@ const useStyles = makeStyles((theme: any) => ({
const Header: React.FC<PropTypes> = ({ logo, contents, page, setPage }) => {
const classes = useStyles();
- const HeaderTab: React.FC<{ item: string }> = ({ item }) => {
- const icon = contents[item];
- return (
- <Tab
- label={item}
- icon={icon}
- value={item}
- className={classes.tab}
- key={item}
- />
- )
- };
-
const handleChange = (event: any, newPage: string) => {
setPage(newPage);
};
@@ -74,7 +62,13 @@ const Header: React.FC<PropTypes> = ({ logo, contents, page, setPage }) => {
</Typography>
<Tabs onChange={handleChange} value={page}>
{contents && Object.keys(contents).map((item: string) => (
- <HeaderTab item={item}/>
+ <Tab
+ label={item}
+ icon={contents[item] as JSX.Element}
+ value={item}
+ className={classes.tab}
+ key={item}
+ />
))}
</Tabs>
</Toolbar>