aboutsummaryrefslogtreecommitdiff
path: root/src/components/Header/BrowserHeader.tsx
blob: 2acb69c03f35e182f27c124d281af3d6bd3338ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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;
  menu: 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',
    alignItems: 'center'
  }
});


const BrowserHeader: React.FC<PropTypes> = React.memo(props => {
  const classes = useStyles();
  const {
    logo,
    menu,
    feed,
    notifications,
    profile
  } = props;

  return (
    <AppBar position="fixed">
      <Toolbar>
        {menu}
        <div className={classes.root}>
          <div className={classes.group}>
            {logo}
          </div>
          <SearchBar />
          <div className={classes.group}>
            {feed}
            {notifications}
            {profile}
          </div>
        </div>
      </Toolbar>
    </AppBar>
  );
});

export default BrowserHeader;