-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathHeader.tsx
158 lines (155 loc) · 5.54 KB
/
Header.tsx
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
"use client";
import Image from "next/image";
import Link from "next/link";
interface Headerprops {
blogsection: boolean;
}
/* eslint-disable @next/next/no-img-element */
export function Header(props: Headerprops) {
const { blogsection } = props;
const handleScroll = (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {
e.preventDefault();
const href = e.currentTarget.href;
const targetId = href.replace(/.*\#/, "");
const elem = document.getElementById(targetId);
elem?.scrollIntoView({
behavior: "smooth",
});
};
return (
<>
{blogsection ? (
<div className="fixed z-50 w-full h-16 max-w-xs md:max-w-3xl -translate-x-1/2 rounded-full top-10 left-1/2 bg-[#1C1C1F] border-solid border border-[#29292d]">
<div className=" md:grid h-full md:grid-cols-6 flex flex-row justify-between mx-auto items-center ml-6 ">
<Link href="/">
<img
className="max-w-[100px] md:max-w-[110px]"
src="/images/intelowlwhite.png"
alt="intelowl logo"
></img>
</Link>
<Link
href="/#feature-section"
className="text-white font-SpaceGrotesk font-light hidden md:flex md:justify-center md:flex-row"
>
Features
</Link>
<Link
href="/docs/"
className="text-white font-SpaceGrotesk font-light text-center invisible md:visible"
>
Docs
</Link>
<Link
href={"/blogs"}
className="text-white font-SpaceGrotesk font-light hidden md:flex md:justify-center md:flex-row"
>
Blogs
</Link>
<Link
href="https://opencollective.com/intelowl-project/donate"
className="text-white font-SpaceGrotesk font-light hidden md:flex md:justify-center md:flex-row"
>
Donate
</Link>
<span className="flex flex-row justify-center space-x-2 mr-5">
<Link href={"https://github.com/intelowlproject"}>
<Image
width={25}
height={25}
className=""
src="/images/githublogo.png"
alt="github logo"
/>
</Link>
<Link href={"https://twitter.com/intel_owl?lang=en"}>
<Image
width={25}
height={25}
className=""
src="/images/twitterlogo.png"
alt="twitter logo"
/>
</Link>
<Link href={"https://www.linkedin.com/company/intelowl"}>
<Image
width={25}
height={25}
className=""
src="/images/linkedinlogo.png"
alt="linkedin logo"
/>
</Link>
</span>
</div>
</div>
) : (
<div className="fixed z-50 w-full h-16 max-w-xs md:max-w-3xl -translate-x-1/2 rounded-full top-10 left-1/2 bg-[#1C1C1F] border-solid border border-[#29292d]">
<div className=" md:grid h-full md:grid-cols-6 flex flex-row justify-between mx-auto items-center ml-6 ">
<Link href="#hero-section" onClick={handleScroll}>
<img
className="max-w-[100px] md:max-w-[110px]"
src="/images/intelowlwhite.png"
alt="intelowl logo"
></img>
</Link>
<Link
href="#feature-section"
onClick={handleScroll}
className="text-white font-SpaceGrotesk font-light hidden md:flex md:justify-center md:flex-row"
>
Features
</Link>
<Link
href="/docs/"
className="text-white font-SpaceGrotesk font-light text-center hidden md:flex md:justify-center md:flex-row"
>
Docs
</Link>
<Link
href="/blogs"
className="text-white font-SpaceGrotesk font-light text-center hidden md:flex md:justify-center md:flex-row"
>
Blogs
</Link>
<Link
href="https://opencollective.com/intelowl-project/donate"
className="text-white font-SpaceGrotesk font-light text-center hidden md:flex md:justify-center md:flex-row"
>
Donate
</Link>
<span className="flex flex-row justify-center space-x-2 mr-5">
<Link href={"https://github.com/intelowlproject"}>
<Image
width={25}
height={25}
className=""
src="/images/githublogo.png"
alt="intelowl logo"
/>
</Link>
<Link href={"https://twitter.com/intel_owl?lang=en"}>
<Image
width={25}
height={25}
className=""
src="/images/twitterlogo.png"
alt="intelowl logo"
/>
</Link>
<Link href={"https://www.linkedin.com/company/intelowl"}>
<Image
width={25}
height={25}
className=""
src="/images/linkedinlogo.png"
alt="linkedin logo"
/>
</Link>
</span>
</div>
</div>
)}
</>
);
}