From 3c3223c3b41411639ff19ebd58df569cf17999ca Mon Sep 17 00:00:00 2001
From: ilyayudovin <ilyayudovin123@gmail.com>
Date: Sun, 14 Jun 2020 15:56:29 +0300
Subject: divide src into Pages and Components directories

---
 src/Components/Header/Header.tsx | 68 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 src/Components/Header/Header.tsx

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

diff --git a/src/Components/Header/Header.tsx b/src/Components/Header/Header.tsx
new file mode 100644
index 0000000..0ee6b5f
--- /dev/null
+++ b/src/Components/Header/Header.tsx
@@ -0,0 +1,68 @@
+import React from 'react';
+import {
+  AppBar,
+  Toolbar,
+  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';
+import HomeIcon from '@material-ui/icons/Home';
+
+import SearchBar from './SearchBar';
+
+interface PropTypes {
+  setPage: (newPage: string) => void;
+}
+
+const useStyles = makeStyles({
+  root: {
+    display: 'flex',
+    justifyContent: 'space-around',
+    width: '60%',
+    margin: 'auto'
+  },
+  logo: {
+    fontWeight: 'bold'
+  }
+});
+
+const Header: React.FC<PropTypes> = ({ setPage }) => {
+  const classes = useStyles();
+
+  const handleHome = (): void => {
+    setPage('feed');
+  };
+
+  const handleProfile = (): void => {
+    setPage('profile');
+  };
+
+  const handleNotifications = (): void => {};
+
+  return (
+    <AppBar position="fixed">
+      <Toolbar className={classes.root}>
+        <Typography variant="h5" className={classes.logo}>
+          Which
+        </Typography>
+        <SearchBar />
+        <div>
+          <IconButton onClick={handleHome}>
+            <HomeIcon />
+          </IconButton>
+          <IconButton onClick={handleNotifications}>
+            <NotificationsIcon />
+          </IconButton>
+          <IconButton onClick={handleProfile}>
+            <AccountCircle />
+          </IconButton>
+        </div>
+      </Toolbar>
+    </AppBar>
+  );
+};
+
+export default Header;
+
-- 
cgit v1.2.3

