Skip to content

Commit fa7a916

Browse files
Fix types NavItem and SharedData
1 parent 030a3df commit fa7a916

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

resources/js/components/NavMain.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@
22
import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';
33
import { type SharedData } from '@/types';
44
import { Link, usePage } from '@inertiajs/vue3';
5-
import type { Component } from 'vue';
6-
7-
interface NavItem {
8-
title: string;
9-
url: string;
10-
icon: Component;
11-
}
5+
import { type NavItem } from '@/types';
126
137
defineProps<{
148
items: NavItem[];

resources/js/layouts/settings/Layout.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ import { Link } from '@inertiajs/vue3';
88
const sidebarNavItems: NavItem[] = [
99
{
1010
title: 'Profile',
11-
href: '/settings/profile',
11+
url: '/settings/profile',
1212
},
1313
{
1414
title: 'Password',
15-
href: '/settings/password',
15+
url: '/settings/password',
1616
},
1717
{
1818
title: 'Appearance',
19-
href: '/settings/appearance',
19+
url: '/settings/appearance',
2020
},
2121
];
2222
@@ -32,12 +32,12 @@ const currentPath = window.location.pathname;
3232
<nav class="flex flex-col space-x-0 space-y-1">
3333
<Button
3434
v-for="item in sidebarNavItems"
35-
:key="item.href"
35+
:key="item.url"
3636
variant="ghost"
37-
:class="['w-full justify-start', { 'bg-muted': currentPath === item.href }]"
37+
:class="['w-full justify-start', { 'bg-muted': currentPath === item.url }]"
3838
as-child
3939
>
40-
<Link :href="item.href">
40+
<Link :href="item.url">
4141
{{ item.title }}
4242
</Link>
4343
</Button>

resources/js/types/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { LucideIcon } from 'lucide-vue-next';
2+
import type { PageProps } from "@inertiajs/core";
23

34
export interface Auth {
45
user: User;
@@ -11,12 +12,12 @@ export interface BreadcrumbItem {
1112

1213
export interface NavItem {
1314
title: string;
14-
href: string;
15+
url: string;
1516
icon?: LucideIcon;
1617
isActive?: boolean;
1718
}
1819

19-
export interface SharedData {
20+
export interface SharedData extends PageProps {
2021
name: string;
2122
quote: { message: string; author: string };
2223
auth: Auth;

0 commit comments

Comments
 (0)