From a9d713a73b65847af419016d2d97c4e8dab950f9 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Tue, 11 Aug 2020 22:00:10 +0300
Subject: refactor: cleanup header components

---
 src/components/Header/BrowserHeader.tsx | 51 +++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 src/components/Header/BrowserHeader.tsx

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

diff --git a/src/components/Header/BrowserHeader.tsx b/src/components/Header/BrowserHeader.tsx
new file mode 100644
index 0000000..2dda717
--- /dev/null
+++ b/src/components/Header/BrowserHeader.tsx
@@ -0,0 +1,51 @@
+import React from 'react';
+import { AppBar, Toolbar } from '@material-ui/core';
+import { makeStyles } from '@material-ui/core/styles';
+import SearchBar from './SearchBar';
+
+interface PropTypes {
+  logo: JSX.Element;
+  feed: JSX.Element;
+  notifications: JSX.Element;
+  profile: JSX.Element;
+}
+
+const useStyles = makeStyles({
+  root: {
+    width: '60%',
+    margin: 'auto',
+    display: 'flex',
+    justifyContent: 'space-around'
+  },
+  group: {
+    display: 'flex'
+  }
+});
+
+
+const BrowserHeader: React.FC<PropTypes> = React.memo(props => {
+  const classes = useStyles();
+  const {
+    logo,
+    feed,
+    notifications,
+    profile
+  } = props;
+
+  return (
+    <AppBar position="fixed">
+      <Toolbar className={classes.root}>
+        {logo}
+        <SearchBar />
+        <div className={classes.group}>
+          {feed}
+          {notifications}
+          {profile}
+        </div>
+      </Toolbar>
+    </AppBar>
+  );
+});
+
+export default BrowserHeader;
+
-- 
cgit v1.2.3

