-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathheader.js
More file actions
55 lines (43 loc) · 1.14 KB
/
header.js
File metadata and controls
55 lines (43 loc) · 1.14 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
import taskmatelogo from './taskmatelogo.png'
import React from 'react'
import './header.css'
import darkmode from'./darkmode.png'
import lightmode from './lightmode.png'
import user from './user.png'
function Header({theme, settheme}) {
const lighttheme=()=>{
settheme("light")
}
const darktheme=()=>{
settheme("dark")
}
return (
<header data-theme={theme}>
<span className="logo">
<img src={taskmatelogo} alt="TaskMate logo" />
<span>TaskMate</span>
</span>
<nav>
<a href="/tasks">Tasks</a>
<a href="/about">About</a>
</nav>
<span className="themeSelector">
{theme === "light" ? (
<img
src={lightmode}
alt="Light mode icon"
onClick={darktheme}
/>
) : (
<img
src={darkmode}
alt="Dark mode icon"
onClick={lighttheme}
/>
)}
</span>
<img className='user' src={user} alt="user avatar"/>
</header>
)
}
export default Header