diff --git a/src/components/Nav/index.astro b/src/components/Nav/index.astro index 320add0aef..50f71c6d4c 100644 --- a/src/components/Nav/index.astro +++ b/src/components/Nav/index.astro @@ -1,6 +1,5 @@ --- import { getCurrentLocale, getUiTranslator } from "@/src/i18n/utils"; -import { jumpToState } from "@/src/globals/state"; import styles from "./styles.module.scss"; import { NavPanels } from "./NavPanels"; @@ -9,6 +8,7 @@ const currentLocale = getCurrentLocale(Astro.url.pathname); const pathMinusLocale = Astro.url.pathname.replace(`/${currentLocale}`, ""); const isHomepage = pathMinusLocale === "/"; const t = await getUiTranslator(currentLocale); +const { jumpToState } = Astro.props; const mainLinks = [ { url: "/reference/", label: t("Reference") }, diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 76e040a196..9bc1f54334 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -7,6 +7,7 @@ import ItemPageHeader from "@/src/components/PageHeader/ItemPage.astro"; import HomePageHeader from "@/src/components/PageHeader/HomePage.astro"; import { getCurrentLocale, getUiTranslator } from "@i18n/utils"; import { capitalize, getTopicInfo, type PageTopic } from "../pages/_utils"; +import { type JumpToState } from "@src/globals/state"; import "@styles/base.scss"; import type { CollectionEntry } from "astro:content"; import { getCollectionInLocaleWithFallbacks } from "@pages/_utils"; @@ -21,6 +22,7 @@ interface Props { variant?: "root" | "item" | "search" | "homepage"; topic?: PageTopic; mainContentParentClass?: string; + jumpToState?: JumpToState | null; /* Only needed for the homepage */ homepageConfig?: CollectionEntry<"homepage">; } @@ -34,6 +36,7 @@ const { variant = "root", mainContentParentClass = "mx-5 md:mx-lg mt-md", homepageConfig, + jumpToState } = Astro.props; const currentLocale = getCurrentLocale(Astro.url.pathname); @@ -87,7 +90,7 @@ const headerTopic = topic
-