From be62d848cc129c2d13e33fefa02c801b71667636 Mon Sep 17 00:00:00 2001 From: Takeshi Kimata <117462761+kimatata@users.noreply.github.com> Date: Sun, 12 May 2024 20:22:21 +0900 Subject: [PATCH] Implement slider when screen width is small --- frontend/src/app/[locale]/Header.tsx | 98 +++++++++++++++++++++------- 1 file changed, 76 insertions(+), 22 deletions(-) diff --git a/frontend/src/app/[locale]/Header.tsx b/frontend/src/app/[locale]/Header.tsx index 0afda10..8480982 100644 --- a/frontend/src/app/[locale]/Header.tsx +++ b/frontend/src/app/[locale]/Header.tsx @@ -1,8 +1,11 @@ import { Navbar as NextUINavbar, NavbarContent, + NavbarMenu, + NavbarMenuToggle, NavbarBrand, NavbarItem, + NavbarMenuItem, Chip, Link as NextUiLink, } from "@nextui-org/react"; @@ -17,6 +20,22 @@ import Image from "next/image"; export default function Header(params: { locale: string }) { const t = useTranslations("Header"); + // Links shown Header or slider + const commonLinks = [ + { + uid: "projects", + href: "/projects", + label: t("projects"), + isExternal: false, + }, + { + uid: "docs", + href: "https://kimatata.github.io/TestPlat/docs/getstarted/selfhost", + label: t("docs"), + isExternal: true, + }, + ]; + return ( @@ -35,7 +54,7 @@ export default function Header(params: { locale: string }) {

TestPlat

- + - - - {t("projects")} - - - - } - > - {t("docs")} - - + {commonLinks.map((link) => + link.isExternal ? ( + + } + > + {t("docs")} + + + ) : ( + + + {link.label} + + + ) + )}
@@ -73,12 +97,42 @@ export default function Header(params: { locale: string }) { isExternal href="https://github.com/kimatata/TestPlat" aria-label="Github" + className="hidden md:flex" > - + + + + +
+ {commonLinks.map((link) => + link.isExternal ? ( + + } + > + {t("docs")} + + + ) : ( + + + {link.label} + + + ) + )} +
+
); }