From 90fd80fec9cc300662b92144786a418f1fb05e61 Mon Sep 17 00:00:00 2001 From: emily Date: Wed, 29 Apr 2026 16:18:14 -0700 Subject: [PATCH 01/13] Fix visual bug appearing in the left nav bar for the "Examples" section of the site --- src/components/Nav/index.astro | 2 +- src/layouts/BaseLayout.astro | 5 ++++- src/layouts/ExampleLayout.astro | 4 +--- src/layouts/ExamplesLayout.astro | 10 ++-------- 4 files changed, 8 insertions(+), 13 deletions(-) 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..3bfc32d49b 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; /* 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
-