Skip to content

Commit 9825ff1

Browse files
committed
Take Pathname type into use
1 parent b6f8081 commit 9825ff1

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/routes/Header.svelte

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,17 @@
1212
import { BreadCrumbStore } from '$lib/stores/BreadCrumbStore';
1313
import { UserStore } from '$lib/stores/UserStore';
1414
import { cn } from '$lib/utils';
15+
import type { Pathname } from '$app/types';
1516
1617
let sidebar = useSidebar();
1718
</script>
1819

19-
{#snippet dropdownItem(name: string, url: string)}
20+
{#snippet dropdownItem(name: string, url: Pathname)}
2021
<DropdownMenu.Item class="cursor-pointer" onclick={() => goto(url)}>
2122
{name}
2223
</DropdownMenu.Item>
2324
{/snippet}
24-
{#snippet headerItem(text: string, href: string)}
25+
{#snippet headerItem(text: string, href: Pathname)}
2526
<Button {href}>{text}</Button>
2627
{/snippet}
2728

src/routes/Sidebar.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import type { AnyComponent } from '$lib/types/AnyComponent';
3737
import { isMobile, isSerialSupported } from '$lib/utils/compatibility';
3838
import { Collapsible } from 'bits-ui';
39+
import type { Pathname } from '$app/types';
3940
4041
let currentUser = $derived($UserStore.self);
4142
@@ -48,7 +49,7 @@
4849
4950
interface Item extends Entry {
5051
class?: string;
51-
href?: string;
52+
href?: Pathname;
5253
target?: string;
5354
}
5455

0 commit comments

Comments
 (0)