Skip to content

Commit c2f5c48

Browse files
authored
fix: update links in header (#35)
1 parent d380af0 commit c2f5c48

File tree

6 files changed

+57
-131
lines changed

6 files changed

+57
-131
lines changed

package-lock.json

Lines changed: 26 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
"deploy": "gh-pages -d build"
1414
},
1515
"dependencies": {
16-
"@studio-freight/lenis": "^1.0.42",
17-
"@studio-freight/react-lenis": "^0.0.46",
1816
"clsx": "^2.1.0",
1917
"gsap": "^3.12.5",
18+
"lenis": "^1.1.18",
2019
"react": "^18.2.0",
2120
"react-dom": "^18.2.0",
2221
"react-router-hash-link": "^2.4.3",

src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import { Header, Footer } from "layout";
2+
import { ReactLenis } from "lenis/react";
13
import Home from "components/Home";
24
import "./App.css";
3-
import { Header, Footer } from "layout";
4-
import { ReactLenis } from "@studio-freight/react-lenis";
55

66
function App() {
77
return (

src/index.css

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@ html.lenis body {
3232

3333
.noisy-bg {
3434
background-image: url("/Noisy-Background.svg");
35-
3635
}
3736

3837
:root {
39-
--primary: #FF4800;
40-
--secondary: #1D1D1D;
41-
--background: #E2DDD6;
42-
font-family: "Neue Machina", system-ui,
43-
sans-serif;
38+
--primary: #ff4800;
39+
--secondary: #1d1d1d;
40+
--background: #e2ddd6;
41+
font-family: "Neue Machina", system-ui, sans-serif;
4442
color-scheme: light dark;
4543
color: var(--secondary);
4644
background-color: var(--background);
@@ -51,7 +49,7 @@ html.lenis body {
5149
text-rendering: optimizeLegibility;
5250
-webkit-font-smoothing: antialiased;
5351
-moz-osx-font-smoothing: grayscale;
54-
52+
scroll-behavior: smooth;
5553

5654
/* spacing */
5755

@@ -74,10 +72,8 @@ html.lenis body {
7472
--sp16: 192px;
7573
--sp17: 224px;
7674
--sp18: 256px;
77-
7875
}
7976

80-
8177
a {
8278
@apply no-underline;
8379
}
@@ -88,37 +84,37 @@ html.lenis body {
8884
@layer base {
8985
.heading-1 {
9086
@apply text-[5.375rem] leading-[91px] -tracking-[2px]
91-
/* font-size: 86px */
87+
/* font-size: 86px */;
9288
}
9389

9490
.heading-2 {
9591
@apply text-[3.5rem] leading-[53px] -tracking-wider
96-
/* font-size: 56px */
92+
/* font-size: 56px */;
9793
}
9894

9995
.heading-3 {
10096
@apply text-[2.875rem] leading-[47px] -tracking-wider
101-
/* font-size: 46px */
97+
/* font-size: 46px */;
10298
}
10399

104100
.title-1 {
105101
@apply text-[2rem] leading-[40px] -tracking-wider
106-
/* font-size: 32px */
102+
/* font-size: 32px */;
107103
}
108104

109105
.title-2 {
110106
@apply text-[1.75rem] leading-[33px] -tracking-wider
111-
/* font-size: 28px */
107+
/* font-size: 28px */;
112108
}
113109

114110
.title-3 {
115111
@apply text-[1.375rem] leading-[27px] -tracking-wider
116-
/* font-size: 22px */
112+
/* font-size: 22px */;
117113
}
118114

119115
.title-4 {
120116
@apply text-[1.25rem] leading-[24px] -tracking-wider
121-
/* font-size: 20px */
117+
/* font-size: 20px */;
122118
}
123119

124120
h1 {

src/layout/Header.tsx

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,27 @@ import { links } from "./links";
33
import { Logo } from "assets/icons";
44

55
export function Header() {
6-
const handleClickScroll = (id: string) => {
7-
const element = document.getElementById(id);
8-
if (element) {
9-
element.scrollIntoView({ behavior: "smooth" });
10-
}
11-
};
126
return (
137
<header className="container mx-auto px-10 border-b border-secondary py-6">
148
<nav className="flex justify-between items-center">
159
<a draggable={false} href="/">
1610
<Logo className="text-primary" />
1711
</a>
1812
<ul className="list-disc gap-9 md:flex hidden">
19-
{links.map((link, key) => (
20-
<li key={key}>
21-
<button
22-
onClick={() => handleClickScroll(link.link)}
23-
className="title-4 transition-all duration-300 border-b border-transparent hover:border-secondary"
24-
>
25-
{link.name}
26-
</button>
27-
</li>
28-
))}
13+
{links.map((link, key) => {
14+
const isExternalLink = link.link.includes("https");
15+
return (
16+
<li key={key}>
17+
<a
18+
href={link.link}
19+
target={isExternalLink ? "_blank" : "_self"}
20+
className="title-4 transition-all duration-300 border-b border-transparent hover:border-secondary"
21+
>
22+
{link.name}
23+
</a>
24+
</li>
25+
);
26+
})}
2927
</ul>
3028
<Link className="title-4" variant="primary" href="mailto:hi@dezh.tech">
3129
Contact us

src/layout/links.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ type LinkT = {
66
export const links: LinkT[] = [
77
{
88
name: "Our Partners",
9-
link: "our-Partners",
9+
link: "#our-Partners",
1010
},
1111
{
1212
name: "Community",
13-
link: "community",
13+
link: "#community",
1414
},
1515
{
1616
name: "Documents",

0 commit comments

Comments
 (0)