-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathHeader.js
More file actions
63 lines (59 loc) · 1.82 KB
/
Header.js
File metadata and controls
63 lines (59 loc) · 1.82 KB
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
60
61
62
63
import React,{useContext} from 'react';
import {useHistory} from 'react-router-dom'
import './Header.css';
import OlxLogo from '../../assets/OlxLogo';
import Search from '../../assets/Search';
import Arrow from '../../assets/Arrow';
import SellButton from '../../assets/SellButton';
import SellButtonPlus from '../../assets/SellButtonPlus';
import { AuthContext, FirebaseContext } from '../../store/Context';
function Header() {
const history=useHistory()
const {user}=useContext(AuthContext)
const {firebase}=useContext(FirebaseContext)
return (
<div className="headerParentDiv">
<div className="headerChildDiv">
<div className="brandName">
<OlxLogo></OlxLogo>
</div>
<div className="placeSearch">
<Search></Search>
<input type="text" />
<Arrow></Arrow>
</div>
<div className="productSearch">
<div className="input">
<input
type="text"
placeholder="Find car,mobile phone and more..."
/>
</div>
<div className="searchAction">
<Search color="#ffffff"></Search>
</div>
</div>
<div className="language">
<span> ENGLISH </span>
<Arrow></Arrow>
</div>
<div className="loginPage">
<span>{user ? `Welcome ${user.displayName}` :"Login" }</span>
<hr />
</div>
{user && <span onClick={()=>{
firebase.auth().signOut()
history.push('/login')
}}>Logout</span> }
<div className="sellMenu">
<SellButton></SellButton>
<div className="sellMenuContent">
<SellButtonPlus></SellButtonPlus>
<span>SELL</span>
</div>
</div>
</div>
</div>
);
}
export default Header;