Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions resources/js/components/NavMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuButton, SidebarMenuItem } from '@/components/ui/sidebar';
import { type SharedData } from '@/types';
import { Link, usePage } from '@inertiajs/vue3';
import type { Component } from 'vue';

interface NavItem {
title: string;
url: string;
icon: Component;
}
import { type NavItem } from '@/types';

defineProps<{
items: NavItem[];
Expand Down
12 changes: 6 additions & 6 deletions resources/js/layouts/settings/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { Link } from '@inertiajs/vue3';
const sidebarNavItems: NavItem[] = [
{
title: 'Profile',
href: '/settings/profile',
url: '/settings/profile',
},
{
title: 'Password',
href: '/settings/password',
url: '/settings/password',
},
{
title: 'Appearance',
href: '/settings/appearance',
url: '/settings/appearance',
},
];

Expand All @@ -32,12 +32,12 @@ const currentPath = window.location.pathname;
<nav class="flex flex-col space-x-0 space-y-1">
<Button
v-for="item in sidebarNavItems"
:key="item.href"
:key="item.url"
variant="ghost"
:class="['w-full justify-start', { 'bg-muted': currentPath === item.href }]"
:class="['w-full justify-start', { 'bg-muted': currentPath === item.url }]"
as-child
>
<Link :href="item.href">
<Link :href="item.url">
{{ item.title }}
</Link>
</Button>
Expand Down
5 changes: 3 additions & 2 deletions resources/js/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { LucideIcon } from 'lucide-vue-next';
import type { PageProps } from "@inertiajs/core";

export interface Auth {
user: User;
Expand All @@ -11,12 +12,12 @@ export interface BreadcrumbItem {

export interface NavItem {
title: string;
href: string;
url: string;
icon?: LucideIcon;
isActive?: boolean;
}

export interface SharedData {
export interface SharedData extends PageProps {
name: string;
quote: { message: string; author: string };
auth: Auth;
Expand Down