diff options
author | Eug-VS <eug-vs@keemail.me> | 2020-02-03 21:07:49 +0300 |
---|---|---|
committer | Eug-VS <eug-vs@keemail.me> | 2020-02-03 21:09:14 +0300 |
commit | 78f5ec6998f96da4f99f169c10e6639dfa818207 (patch) | |
tree | 63714984516743bb504c9bc884a86755920bfb89 /src | |
parent | ddb2ba73406d6982e81bc779c155e6c687f98bb5 (diff) | |
download | react-benzin-78f5ec6998f96da4f99f169c10e6639dfa818207.tar.gz |
fix: correct icon type
This partially reverts last commit
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Header/Header.tsx | 22 |
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> |