-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeader.jsx
More file actions
26 lines (22 loc) · 740 Bytes
/
Header.jsx
File metadata and controls
26 lines (22 loc) · 740 Bytes
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
import React from 'react'
// import { useState } from 'react'
const Header = (props) => {
// const [username, setUsername] = useState('')
// if(!data){
// setUsername('Admin')
// }else{
// setUsername(data.firstname)
// }
const logOutUser=()=>{
localStorage.setItem('loggedInUser','')
// window.location.reload()
props.changeUser('')
}
return (
<div className='flex items-end justify-between'>
<h1 className='text-2xl font-medium'>Hello<br /><span className='text-3xl font-semibold'>username😎</span></h1>
<button onClick={logOutUser} className='bg-red-600 text-white px-5 py-2 text-lg font-medium rounded-sm'>Log Out</button>
</div>
)
}
export default Header