This repository was archived by the owner on Feb 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathHeader.js
More file actions
73 lines (67 loc) · 2.04 KB
/
Header.js
File metadata and controls
73 lines (67 loc) · 2.04 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
64
65
66
67
68
69
70
71
72
73
import React from "react";
import "./Header.css";
import { LinkifyContext } from "../../../context";
import { MdDarkMode, MdLightMode } from "react-icons/md";
import {BsPersonCircle} from "react-icons/bs"
import {
ButtonGroup,
HeaderContainer,
LeftButton,
LogoText,
RightButton,
StyledLink,
} from "./HeaderElements";
export default function Header() {
const { theme, setTheme, setIsModalOpen, signInToggler, logInToggler } =
React.useContext(LinkifyContext);
const handleLogin = () => {
setIsModalOpen(true);
logInToggler();
};
const handleSignin = () => {
setIsModalOpen(true);
signInToggler();
};
return (
<HeaderContainer>
<StyledLink to="/">
<LogoText>Linkify</LogoText>
</StyledLink>
<ButtonGroup>
<LeftButton onClick={handleLogin}>Login</LeftButton>
<RightButton onClick={handleSignin}>Sign Up</RightButton>
<div className="dropdown toggle" >
<button className=" btn btn-dark" style={{backgroundColor:"black",border:"none"}}type="button" data-bs-toggle="dropdown" aria-expanded="false">
<BsPersonCircle />
</button>
<ul className="dropdown-menu dark">
<li><button className="dropdown-item " onClick={handleSignin}> SignUp</button></li>
<li><button className="dropdown-item " onClick={handleLogin}>LogIn</button></li>
</ul>
</div>
{/* <StyledLink>
<Toggle
onClick={handleSubmit}
className={theme === "light-theme" ? "lightfont" : "darkfont"}
>
Toggle
</Toggle>
</StyledLink> */}
<div className="toggle-container">
{theme === "light-theme" && (
<MdDarkMode
className="toggle-icon"
onClick={() => setTheme("dark-theme")}
/>
)}
{theme === "dark-theme" && (
<MdLightMode
className="toggle-icon darkfont"
onClick={() => setTheme("light-theme")}
/>
)}
</div>
</ButtonGroup>
</HeaderContainer>
);
}