chore: upgrade SvelteKit (#20736)

This commit is contained in:
Ben McCann
2025-08-07 05:00:42 -07:00
committed by GitHub
parent 395f2e155d
commit af10c3bc2f
4 changed files with 33 additions and 27 deletions

View File

@@ -1,5 +1,4 @@
<script lang="ts">
import { resolveRoute } from '$app/paths';
import { page } from '$app/state';
import Icon from '$lib/components/elements/icon.svelte';
import { mdiChevronDown, mdiChevronLeft } from '@mdi/js';
@@ -8,7 +7,7 @@
interface Props {
title: string;
routeId: string;
href: string;
icon: string;
flippedLogo?: boolean;
isSelected?: boolean;
@@ -19,7 +18,7 @@
let {
title,
routeId,
href,
icon,
flippedLogo = false,
isSelected = $bindable(false),
@@ -28,10 +27,8 @@
dropdownOpen = $bindable(false),
}: Props = $props();
let routePath = $derived(resolveRoute(routeId, {}));
$effect(() => {
isSelected = (page.route.id?.match(/^\/(admin|\(user\))\/[^/]*/) || [])[0] === routeId;
isSelected = (page.url.pathname.match(/^\/(admin|user)\/[^/]*/) || [])[0] === href;
});
</script>
@@ -55,7 +52,7 @@
</span>
{/if}
<a
href={routePath}
{href}
data-sveltekit-preload-data={preloadData ? 'hover' : 'off'}
draggable="false"
aria-current={isSelected ? 'page' : undefined}