From 78f5ec6998f96da4f99f169c10e6639dfa818207 Mon Sep 17 00:00:00 2001
From: Eug-VS <eug-vs@keemail.me>
Date: Mon, 3 Feb 2020 21:07:49 +0300
Subject: fix: correct icon type

This partially reverts last commit
---
 src/lib/Header/Header.tsx | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

(limited to 'src/lib/Header/Header.tsx')

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>
-- 
cgit v1.2.3

