From f2f573d927365b08190f08aaa1f46cb4ad172424 Mon Sep 17 00:00:00 2001 From: Piotr Monwid-Olechnowicz Date: Wed, 23 Apr 2025 23:51:13 +0200 Subject: [PATCH 1/3] Add Navbar --- src/app/conf/2025/components/hero/index.tsx | 10 +- src/app/conf/2025/components/navbar.tsx | 134 ++++++++++++++++++++ src/app/conf/2025/layout.tsx | 17 +-- src/app/conf/_components/button.tsx | 2 +- tailwind.config.ts | 1 - 5 files changed, 143 insertions(+), 21 deletions(-) create mode 100644 src/app/conf/2025/components/navbar.tsx diff --git a/src/app/conf/2025/components/hero/index.tsx b/src/app/conf/2025/components/hero/index.tsx index adab4cdc89..8f374befab 100644 --- a/src/app/conf/2025/components/hero/index.tsx +++ b/src/app/conf/2025/components/hero/index.tsx @@ -56,18 +56,16 @@ export function Hero() { function DateAndLocation() { return ( -
+
- + -
- -
- Amsterdam, Netherlands -
+ +
Amsterdam, Netherlands
) diff --git a/src/app/conf/2025/components/navbar.tsx b/src/app/conf/2025/components/navbar.tsx new file mode 100644 index 0000000000..d6eb7d3a3b --- /dev/null +++ b/src/app/conf/2025/components/navbar.tsx @@ -0,0 +1,134 @@ +"use client" + +import { + ReactElement, + ReactNode, + useCallback, + useEffect, + useState, +} from "react" +import NextLink from "next/link" +import { clsx } from "clsx" +import { usePathname } from "next/navigation" + +import { HamburgerIcon, CrossIcon } from "@/icons" + +import { Badge } from "../../_components/badge" + +export interface NavbarProps { + links: { href: string; children: React.ReactNode; "aria-disabled"?: true }[] + year: number +} + +export function Navbar({ links, year }: NavbarProps): ReactElement { + const pathname = usePathname() + const [mobileDrawerOpen, setMobileDrawerOpen] = useState(false) + + const handleDrawerClick = useCallback(() => { + setMobileDrawerOpen(prev => !prev) + }, []) + + useEffect(() => { + setMobileDrawerOpen(false) + }, [pathname]) + + return ( + <> +
+
+
+ {/* todo: better backdrop */} +
+
+ + + + / GraphQLConf {year} +
+ + {mobileDrawerOpen && ( +
+ )} + + + + +
+
+ + ) +} + +function GraphQLLogo(props: React.SVGProps) { + return ( + + + + + + + + + + ) +} diff --git a/src/app/conf/2025/layout.tsx b/src/app/conf/2025/layout.tsx index 5cc02638a8..271ae1807c 100644 --- a/src/app/conf/2025/layout.tsx +++ b/src/app/conf/2025/layout.tsx @@ -1,11 +1,11 @@ import { ReactElement, ReactNode } from "react" import { Metadata } from "next" -import { Header } from "../_components/header" import { Footer } from "../_components/footer" import { GraphQLConf, HostedByGraphQLFoundation } from "@/icons" import NextLink from "next/link" import { NewFontsStyleTag } from "../../fonts" import "../../colors.css" +import { Navbar } from "./components/navbar" // @ts-expect-error: we want to import the same version as Nextra for the main page import { ThemeProvider } from "next-themes" @@ -36,16 +36,8 @@ export default function Layout({ return ( <> -
- - 2025 - - } + -
{children}
+
{children}