Skip to content

Commit ca9f1cd

Browse files
Improve Breadcrumb type and usage (#303)
Co-authored-by: WendellAdriel <11641518+WendellAdriel@users.noreply.github.com> Co-authored-by: WendellAdriel <me@wendelladriel.com>
1 parent 380df89 commit ca9f1cd

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

resources/js/components/Breadcrumbs.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ defineProps<Props>();
2727
</template>
2828
<template v-else>
2929
<BreadcrumbLink as-child>
30-
<Link :href="item.href ?? '#'">{{
31-
item.title
32-
}}</Link>
30+
<Link :href="item.href">{{ item.title }}</Link>
3331
</BreadcrumbLink>
3432
</template>
3533
</BreadcrumbItem>

resources/js/pages/Dashboard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { dashboard } from '@/routes';
88
const breadcrumbs: BreadcrumbItem[] = [
99
{
1010
title: 'Dashboard',
11-
href: dashboard().url,
11+
href: dashboard(),
1212
},
1313
];
1414
</script>

resources/js/pages/settings/Appearance.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { edit } from '@/routes/appearance';
1010
const breadcrumbItems: BreadcrumbItem[] = [
1111
{
1212
title: 'Appearance settings',
13-
href: edit().url,
13+
href: edit(),
1414
},
1515
];
1616
</script>

resources/js/pages/settings/Profile.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ defineProps<Props>();
2222
const breadcrumbItems: BreadcrumbItem[] = [
2323
{
2424
title: 'Profile settings',
25-
href: edit().url,
25+
href: edit(),
2626
},
2727
];
2828

resources/js/types/navigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { LucideIcon } from 'lucide-vue-next';
33

44
export type BreadcrumbItem = {
55
title: string;
6-
href?: string;
6+
href: NonNullable<InertiaLinkProps['href']>;
77
};
88

99
export type NavItem = {

0 commit comments

Comments
 (0)