From dcb9b3aeb6dec55b133afa5748233494e8374fcd Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 7 Jun 2020 19:11:22 +0300
Subject: feat: add searchbar and improve header

---
 src/Header/Header.tsx | 52 ++++++++++++++++++++++++++-------------------------
 1 file changed, 27 insertions(+), 25 deletions(-)

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

diff --git a/src/Header/Header.tsx b/src/Header/Header.tsx
index 8e8a301..5ce79be 100644
--- a/src/Header/Header.tsx
+++ b/src/Header/Header.tsx
@@ -2,45 +2,47 @@ import React from 'react';
 import {
   AppBar,
   Toolbar,
-  Tabs,
-  Tab
+  IconButton,
+  Typography
 } from '@material-ui/core';
 import { makeStyles } from '@material-ui/core/styles';
+import AccountCircle from '@material-ui/icons/AccountCircle';
+import NotificationsIcon from '@material-ui/icons/Notifications';
 
-interface PropTypes {
-  page: string;
-  setPage: (newPage: string) => void;
-}
+import SearchBar from './SearchBar';
 
 const useStyles = makeStyles(theme => ({
-  tab: {
-    '& .MuiTab-wrapper': {
-      padding: theme.spacing(2),
-      flexDirection: 'row',
-      fontSize: '0.8125rem'
-    }
+  root: {
+    display: 'flex',
+    justifyContent: 'space-around',
+    width: '60%',
+    margin: 'auto'
+  },
+  logo: {
+    fontWeight: 'bold',
   }
 }));
 
-const tabs = ['Profile', 'Feed'];
-
-const Header: React.FC<PropTypes> = ({ page /* , setPage */ }) => {
+const Header: React.FC = () => {
   const classes = useStyles();
 
   const handleChange = () => {};
 
   return (
     <AppBar position="static">
-      <Toolbar>
-        <Tabs onChange={handleChange} value={page}>
-          {tabs.map((tab: string) => (
-            <Tab
-              label={tab}
-              key={tab}
-              className={classes.tab}
-            />
-          ))}
-        </Tabs>
+      <Toolbar className={classes.root}>
+        <Typography variant="h5" className={classes.logo}>
+          Which
+        </Typography>
+        <SearchBar />
+        <div>
+          <IconButton>
+            <NotificationsIcon />
+          </IconButton>
+          <IconButton>
+            <AccountCircle />
+          </IconButton>
+        </div>
       </Toolbar>
     </AppBar>
   );
-- 
cgit v1.2.3


From 4a6ba7568598bf39fc3be775c22929ebfb8fc78f Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 7 Jun 2020 19:12:40 +0300
Subject: fix: change header position to fixed

---
 src/Header/Header.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/src/Header/Header.tsx b/src/Header/Header.tsx
index 5ce79be..c92208a 100644
--- a/src/Header/Header.tsx
+++ b/src/Header/Header.tsx
@@ -29,7 +29,7 @@ const Header: React.FC = () => {
   const handleChange = () => {};
 
   return (
-    <AppBar position="static">
+    <AppBar position="fixed">
       <Toolbar className={classes.root}>
         <Typography variant="h5" className={classes.logo}>
           Which
-- 
cgit v1.2.3


From 26911f1e971b798aac51e15ae3b54a4f40dd334a Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 7 Jun 2020 19:34:14 +0300
Subject: feat: change pages in header

---
 src/Header/Header.tsx | 30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

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

diff --git a/src/Header/Header.tsx b/src/Header/Header.tsx
index c92208a..0ee6b5f 100644
--- a/src/Header/Header.tsx
+++ b/src/Header/Header.tsx
@@ -8,10 +8,15 @@ import {
 import { makeStyles } from '@material-ui/core/styles';
 import AccountCircle from '@material-ui/icons/AccountCircle';
 import NotificationsIcon from '@material-ui/icons/Notifications';
+import HomeIcon from '@material-ui/icons/Home';
 
 import SearchBar from './SearchBar';
 
-const useStyles = makeStyles(theme => ({
+interface PropTypes {
+  setPage: (newPage: string) => void;
+}
+
+const useStyles = makeStyles({
   root: {
     display: 'flex',
     justifyContent: 'space-around',
@@ -19,14 +24,22 @@ const useStyles = makeStyles(theme => ({
     margin: 'auto'
   },
   logo: {
-    fontWeight: 'bold',
+    fontWeight: 'bold'
   }
-}));
+});
 
-const Header: React.FC = () => {
+const Header: React.FC<PropTypes> = ({ setPage }) => {
   const classes = useStyles();
 
-  const handleChange = () => {};
+  const handleHome = (): void => {
+    setPage('feed');
+  };
+
+  const handleProfile = (): void => {
+    setPage('profile');
+  };
+
+  const handleNotifications = (): void => {};
 
   return (
     <AppBar position="fixed">
@@ -36,10 +49,13 @@ const Header: React.FC = () => {
         </Typography>
         <SearchBar />
         <div>
-          <IconButton>
+          <IconButton onClick={handleHome}>
+            <HomeIcon />
+          </IconButton>
+          <IconButton onClick={handleNotifications}>
             <NotificationsIcon />
           </IconButton>
-          <IconButton>
+          <IconButton onClick={handleProfile}>
             <AccountCircle />
           </IconButton>
         </div>
-- 
cgit v1.2.3

