-
Notifications
You must be signed in to change notification settings - Fork 0
/
Header.js
46 lines (40 loc) · 1.8 KB
/
Header.js
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
import React from 'react';
import "./Header.css";
import SearchIcon from '@material-ui/icons/Search';
import HeaderOption from "./HeaderOption";
import HomeIcon from '@material-ui/icons/Home';
import SupervisorAccountIcon from '@material-ui/icons/SupervisorAccount';
import BusinessCenterIcon from '@material-ui/icons/BusinessCenter';
import ChatIcon from '@material-ui/icons/Chat';
import NotificationsIcon from '@material-ui/icons/Notifications';
import { useDispatch } from 'react-redux';
import { auth } from './firebase';
// import { logout } from "./features/userSlice";
import { logout } from "./features/userSlice";
function Header() {
const dispatch = useDispatch();
const logoutOfApp = () => {
dispatch(logout());
auth.signOut();
};
return (
<div className="Header">
<div className="header__left">
<img src="https://www.flaticon.com/svg/static/icons/svg/174/174857.svg" alt="logo" />
<div className="header__search">
<SearchIcon />
<input placeholder="Search" type="text" />
</div>
</div>
<div className="header__right">
<HeaderOption Icon={HomeIcon} title="Home" className="home"/>
<HeaderOption Icon={SupervisorAccountIcon} title="My Network" className="Super" />
<HeaderOption Icon={BusinessCenterIcon} title="Jobs" className="Biz" />
<HeaderOption Icon={ChatIcon} title="Messaging" className="Chat"/>
<HeaderOption Icon={NotificationsIcon} title="Notifications" className="Notif"/>
<HeaderOption avatar={true} title='me' onClick={logoutOfApp}/>
</div>
</div>
)
}
export default Header;