-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathHeader.jsx
86 lines (81 loc) · 2.63 KB
/
Header.jsx
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
74
75
76
77
78
79
80
81
82
83
84
85
86
import Image from "next/image";
import Link from "next/link";
import React, { useState, useRef } from "react";
const Header = () => {
const [isDropdownOpen, setIsDropdownOpen] = useState(false);
const timeoutRef = useRef(null);
const handleMouseEnter = () => {
clearTimeout(timeoutRef.current);
setIsDropdownOpen(true);
};
const handleMouseLeave = () => {
timeoutRef.current = setTimeout(() => {
setIsDropdownOpen(false);
}, 200);
};
return (
<div className="h-[72px] w-full flex items-center justify-between bg-[#D9D9D9]">
<div className="flex justify-between w-full px-10">
<div className="w-[201px] ml-5">
<Image
src="/assets/Home/Logo_Home.png"
alt=""
width={181}
height={38}
/>
</div>
<div className="w-[597px] p-2 flex justify-between px-6">
<Link href="/" className="text-[#000000] w-auto">
Home
</Link>
<div
className="relative w-auto"
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>
<div className="text-[#000000] cursor-pointer w-auto">
Explore
</div>
{isDropdownOpen && (
<div className="absolute top-full mt-2 w-40 bg-white shadow-lg rounded-md">
<Link
href="/intro"
className="block px-4 py-2 rounded-t-md text-[#000000] hover:bg-gray-200"
>
Intro
</Link>
<Link
href="/git-and-github/how-to-install-git-git-tutorial"
className="block px-4 py-2 text-[#000000] hover:bg-gray-200"
>
Git and GitHub
</Link>
<Link
href="/blog/5-best-apps-vloggers-should-have-on-a-phone"
className="block px-4 py-2 rounded-b-md text-[#000000] hover:bg-gray-200"
>
All Blogs
</Link>
</div>
)}
</div>
<Link href="/" className="text-[#000000] w-auto">
About
</Link>
<Link href="/" className="text-[#000000] w-auto">
Events
</Link>
<Link href="/" className="text-[#000000] w-auto">
Sign in
</Link>
<Link href="/">
<button className="bg-black text-white w-auto px-5 py-1 font-bold rounded-3xl">
Get Started
</button>
</Link>
</div>
</div>
</div>
);
};
export default Header;