diff --git a/packages/website/src/components/NavbarDesktop.astro b/packages/website/src/components/NavbarDesktop.astro index c63164bf0..2f110f0da 100644 --- a/packages/website/src/components/NavbarDesktop.astro +++ b/packages/website/src/components/NavbarDesktop.astro @@ -1,19 +1,21 @@ --- import { GearIcon } from "@radix-ui/react-icons"; import { api } from "../api/dynamic"; -import { tools } from "../constants/tools"; +import { tools, type Tool } from "../constants/tools"; import type { LocaleAcceptorProps } from "../hooks/useLocale"; import { Logo } from "../icons/Logo"; import { LinkI18nWrapper } from "./LinkI18nWrapper"; import { Text } from "./Text"; -type Props = LocaleAcceptorProps; +export type Props = LocaleAcceptorProps & { + tool: Tool; +}; const { locale } = Astro.props; const strings = await api.strings(locale); -const filtered = Object.values(tools).filter( +export const filtered = Object.values(tools).filter( (tool) => !tool.href && (tool.navbar ?? true), ); --- diff --git a/packages/website/src/components/NavbarMobile.astro b/packages/website/src/components/NavbarMobile.astro index f71671795..b5fcd095e 100644 --- a/packages/website/src/components/NavbarMobile.astro +++ b/packages/website/src/components/NavbarMobile.astro @@ -1,14 +1,12 @@ --- import { CaretUpIcon, GearIcon } from "@radix-ui/react-icons"; import { api } from "../api/dynamic"; -import type { Tool } from "../constants/tools"; -import type { LocaleAcceptorProps } from "../hooks/useLocale"; import { Logo } from "../icons/Logo"; +import { LinkI18nWrapper } from "./LinkI18nWrapper"; +import { filtered } from "./NavbarDesktop.astro"; +import { Scroller, ScrollerOrientation } from "./Scroller"; import { Text } from "./Text"; - -type Props = LocaleAcceptorProps & { - tool: Tool; -}; +export { type Props } from "./NavbarDesktop.astro"; const { locale, tool } = Astro.props; @@ -18,73 +16,164 @@ const strings = await api.strings(locale); - - + + + + {filtered.map((tool) => ( + + + - - + + {strings.tools[tool.id as keyof typeof strings.tools].name} + + + + ))} + + - - {strings.tools[tool.id as keyof typeof strings.tools].name} - + + + + - + + + + + {strings.tools[tool.id as keyof typeof strings.tools].name} + + + + + + + + - - + + diff --git a/scripts/dev-website.sh b/scripts/dev-website.sh index 69b8adc76..bc149941f 100755 --- a/scripts/dev-website.sh +++ b/scripts/dev-website.sh @@ -1,2 +1,2 @@ cd packages/website -bun x --bun astro dev \ No newline at end of file +bun x --bun astro dev "$@" \ No newline at end of file