Skip to content

Commit d9ed443

Browse files
committed
feat: Implement header, footer, and menu components; update homepage layout
Signed-off-by: Daniel Ntege <danientege785@gmail.com>
1 parent 36224fe commit d9ed443

File tree

7 files changed

+192
-57
lines changed

7 files changed

+192
-57
lines changed

nextjs/app/globals.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ footer {
7373
@apply border-t border-charcoal border-solid;
7474
}
7575

76-
a {
76+
main a:not([class]) {
7777
@apply text-red underline;
7878
}
7979

nextjs/app/layout.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { Metadata } from "next";
22
import { Space_Grotesk, IBM_Plex_Mono } from "next/font/google";
33
import "./globals.css";
4+
import Header from "@/components/Header";
5+
import Footer from "@/components/Footer";
46

57
const spaceGrotesk = Space_Grotesk({
68
variable: "--font-space-grotesk",
@@ -23,6 +25,11 @@ export const metadata: Metadata = {
2325
},
2426
description:
2527
"Hiero is the first open-source distributed ledger technology (DLT) developed in a fully vendor-neutral way as a project of the Linux Foundation.",
28+
icons: {
29+
icon: "/images/Hiero-Icon.svg",
30+
shortcut: "/images/Hiero-Icon.svg",
31+
apple: "/images/Hiero-Icon.svg",
32+
},
2633
};
2734

2835
export default function RootLayout({
@@ -32,10 +39,14 @@ export default function RootLayout({
3239
}>) {
3340
return (
3441
<html lang="en">
35-
<body
36-
className={`${spaceGrotesk.variable} ${ibmPlexMono.variable}`}
37-
>
38-
{children}
42+
<body className={`${spaceGrotesk.className} ${spaceGrotesk.variable} ${ibmPlexMono.variable}`}>
43+
<header className="relative h-[90px]">
44+
<Header />
45+
</header>
46+
<main>{children}</main>
47+
<footer>
48+
<Footer />
49+
</footer>
3950
</body>
4051
</html>
4152
);

nextjs/app/page.tsx

Lines changed: 15 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,28 @@
1-
import Image from "next/image";
2-
31
export default function Home() {
42
return (
5-
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
6-
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
7-
<Image
8-
className="dark:invert"
9-
src="/next.svg"
10-
alt="Next.js logo"
11-
width={100}
12-
height={20}
13-
priority
14-
/>
15-
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
16-
<h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50">
17-
To get started, edit the page.tsx file.
18-
</h1>
19-
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
20-
Looking for a starting point or more instructions? Head over to{" "}
21-
<a
22-
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
23-
className="font-medium text-zinc-950 dark:text-zinc-50"
24-
>
25-
Templates
26-
</a>{" "}
27-
or the{" "}
28-
<a
29-
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
30-
className="font-medium text-zinc-950 dark:text-zinc-50"
31-
>
32-
Learning
33-
</a>{" "}
34-
center.
35-
</p>
36-
</div>
37-
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
3+
<section className="bg-linear-to-br from-red-dark via-red to-red text-white">
4+
<div className="container py-24 sm:py-36 text-center">
5+
<h1 className="text-4xl sm:text-3xl leading-none tracking-[-0.15rem] mb-4">Hiero Website Migration In Progress</h1>
6+
<p className="text-xl max-w-3xl mx-auto text-white-dark">
7+
This Next.js version is being rebuilt from the Hugo site. Homepage sections are coming next.
8+
</p>
9+
<div className="mt-10 flex flex-col sm:flex-row items-center justify-center gap-4">
3810
<a
39-
className="flex h-12 w-full items-center justify-center gap-2 rounded-full bg-foreground px-5 text-background transition-colors hover:bg-[#383838] dark:hover:bg-[#ccc] md:w-[158px]"
40-
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
11+
href="https://github.com/hiero-ledger/hiero-website"
4112
target="_blank"
4213
rel="noopener noreferrer"
14+
className="bg-white text-charcoal no-underline px-6 py-3 rounded-full font-medium hover:bg-sand transition-colors"
4315
>
44-
<Image
45-
className="dark:invert"
46-
src="/vercel.svg"
47-
alt="Vercel logomark"
48-
width={16}
49-
height={16}
50-
/>
51-
Deploy Now
16+
View Repository
5217
</a>
5318
<a
54-
className="flex h-12 w-full items-center justify-center rounded-full border border-solid border-black/[.08] px-5 transition-colors hover:border-transparent hover:bg-black/[.04] dark:border-white/[.145] dark:hover:bg-[#1a1a1a] md:w-[158px]"
55-
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
56-
target="_blank"
57-
rel="noopener noreferrer"
19+
href="/blog"
20+
className="border border-white text-black no-underline px-6 py-3 rounded-full font-medium hover:bg-white hover:text-charcoal transition-colors"
5821
>
59-
Documentation
22+
Blog (Next.js)
6023
</a>
6124
</div>
62-
</main>
63-
</div>
25+
</div>
26+
</section>
6427
);
6528
}

nextjs/components/Container.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { ReactNode } from "react";
2+
3+
type ContainerProps = {
4+
children: ReactNode;
5+
className?: string;
6+
};
7+
8+
export default function Container({ children, className = "" }: ContainerProps) {
9+
return <div className={`container ${className}`.trim()}>{children}</div>;
10+
}

nextjs/components/Footer.tsx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import Container from "@/components/Container";
2+
3+
export default function Footer() {
4+
return (
5+
<div className="bg-black text-base text-white-dark text-center py-8">
6+
<Container>
7+
<p>
8+
Copyright © Hiero a Series of LF Projects, LLC | For web site terms of use, trademark policy and other
9+
project policies please see{" "}
10+
<a
11+
href="https://lfprojects.org"
12+
target="_blank"
13+
rel="noreferrer noopener"
14+
className="text-white underline hover:text-white"
15+
>
16+
https://lfprojects.org
17+
</a>
18+
.
19+
</p>
20+
</Container>
21+
</div>
22+
);
23+
}

nextjs/components/Header.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Image from "next/image";
2+
import Link from "next/link";
3+
import Container from "@/components/Container";
4+
import Menu from "@/components/Menu";
5+
6+
export default function Header() {
7+
return (
8+
<div className="h-[90px] flex items-center fixed inset-x-0 top-0 z-50 bg-white">
9+
<Container>
10+
<div className="flex flex-row justify-between items-center">
11+
<Link href="/" aria-label="Go to homepage">
12+
<Image src="/images/Hiero-Icon-wLogo.svg" alt="Hiero logo" className="h-[40px] w-[128px]" width={128} height={40} priority />
13+
</Link>
14+
<Menu />
15+
</div>
16+
</Container>
17+
</div>
18+
);
19+
}

nextjs/components/Menu.tsx

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
"use client";
2+
3+
import Image from "next/image";
4+
import Link from "next/link";
5+
import { usePathname } from "next/navigation";
6+
import { useEffect, useState } from "react";
7+
8+
type MenuItem = {
9+
name: string;
10+
href: string;
11+
external?: boolean;
12+
};
13+
14+
const menuItems: MenuItem[] = [
15+
{
16+
name: "Good First Issues",
17+
href: "https://github.com/issues?q=is%3Aopen%20is%3Aissue%20org%3Ahiero-ledger%20archived%3Afalse%20no%3Aassignee%20(label%3A%22good%20first%20issue%22%20OR%20label%3A%22skill%3A%20good%20first%20issue%22)%20(repo%3Ahiero-ledger%2Fhiero-sdk-cpp%20OR%20repo%3Ahiero-ledger%2Fhiero-sdk-swift%20OR%20repo%3Ahiero-ledger%2Fhiero-sdk-python%20OR%20repo%3Ahiero-ledger%2Fhiero-sdk-js%20OR%20repo%3Ahiero-ledger%2Fhiero-website)",
18+
external: true,
19+
},
20+
{ name: "Connect", href: "/#connect" },
21+
{ name: "Blog", href: "/blog" },
22+
{
23+
name: "Calendar",
24+
href: "https://zoom-lfx.platform.linuxfoundation.org/meetings/hiero?view=week",
25+
external: true,
26+
},
27+
];
28+
29+
export default function Menu() {
30+
const pathname = usePathname();
31+
const [isOpen, setIsOpen] = useState(false);
32+
33+
useEffect(() => {
34+
document.body.style.overflow = isOpen ? "hidden" : "";
35+
return () => {
36+
document.body.style.overflow = "";
37+
};
38+
}, [isOpen]);
39+
40+
const isActive = (href: string): boolean => {
41+
if (href.startsWith("http")) return false;
42+
if (href.startsWith("/#")) return pathname === "/";
43+
if (href === "/blog") return pathname === "/blog" || pathname.startsWith("/blog/");
44+
return pathname === href;
45+
};
46+
47+
return (
48+
<>
49+
<button
50+
type="button"
51+
className="sm:hidden"
52+
onClick={() => setIsOpen(true)}
53+
aria-label="Open menu"
54+
aria-expanded={isOpen}
55+
>
56+
<Image src="/images/Hiero-Icon-Nav-Menu.svg" alt="Open menu" className="w-5 h-5" width={20} height={20} />
57+
</button>
58+
59+
<nav
60+
id="navigation"
61+
className={`${isOpen ? "active-navigation" : "hidden"} absolute items-center justify-center w-full h-screen bg-black top-0 left-0 text-white sm:relative sm:h-auto sm:top-auto sm:bg-transparent sm:left-auto sm:w-9/12 sm:max-w-xl sm:block`}
62+
aria-hidden={!isOpen && pathname !== undefined}
63+
>
64+
<div className="absolute top-[27px] sm:hidden">
65+
<Image src="/images/Hiero-Icon-wLogo-white-text.svg" alt="Hiero logo" className="h-[40px] w-[128px]" width={128} height={40} />
66+
</div>
67+
68+
<button
69+
type="button"
70+
className="absolute text-white top-[35px] right-[25px] sm:hidden"
71+
onClick={() => setIsOpen(false)}
72+
aria-label="Close menu"
73+
>
74+
<Image src="/images/Hiero-Icon-ModalClose.svg" alt="Close menu" className="w-5 h-5" width={20} height={20} />
75+
</button>
76+
77+
<ul id="menu" className="flex flex-col sm:flex-row justify-between">
78+
{menuItems.map((item) => (
79+
<li
80+
key={item.name}
81+
className={`text-center sm:text-left ${item.name === "Connect" ? "sm:hidden" : ""}`.trim()}
82+
>
83+
{item.external ? (
84+
<a
85+
href={item.href}
86+
target="_blank"
87+
rel="noopener noreferrer"
88+
onClick={() => setIsOpen(false)}
89+
>
90+
{item.name}
91+
</a>
92+
) : (
93+
<Link href={item.href} className={isActive(item.href) ? "active" : ""} onClick={() => setIsOpen(false)}>
94+
{item.name}
95+
</Link>
96+
)}
97+
</li>
98+
))}
99+
100+
<li className="self-center">
101+
<a href="https://github.com/hiero-ledger/" target="_blank" rel="noopener noreferrer" className="flex">
102+
<Image src="/images/Hiero-Icon-Github.svg" alt="GitHub" className="h-[35px] w-[35px] sm:h-[17px] sm:w-[17px]" width={35} height={35} />
103+
</a>
104+
</li>
105+
</ul>
106+
</nav>
107+
</>
108+
);
109+
}

0 commit comments

Comments
 (0)