Skip to content

Commit b1709db

Browse files
committed
Create AppPageProps
Create AppPageProps that contain all shared props. This avoids having to import SharedProps whenever PageProps are being used
1 parent 512bd78 commit b1709db

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

resources/js/types/index.d.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import type { PageProps } from '@inertiajs/core';
21
import type { LucideIcon } from 'lucide-vue-next';
32
import type { Config } from 'ziggy-js';
43

5-
export interface Auth {
6-
user: User;
7-
}
4+
export type AppPageProps = {
5+
name: string;
6+
quote: { message: string; author: string };
7+
auth: { user: User | null };
8+
ziggy: Config & { location: string };
9+
};
810

911
export interface BreadcrumbItem {
1012
title: string;
@@ -18,13 +20,6 @@ export interface NavItem {
1820
isActive?: boolean;
1921
}
2022

21-
export interface SharedData extends PageProps {
22-
name: string;
23-
quote: { message: string; author: string };
24-
auth: Auth;
25-
ziggy: Config & { location: string };
26-
}
27-
2823
export interface User {
2924
id: number;
3025
name: string;

0 commit comments

Comments
 (0)