File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ public-hoist-pattern[] = @inertiajs/core
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ import { useCurrentUrl } from '@/hooks/use-current-url';
3232import { useInitials } from '@/hooks/use-initials' ;
3333import { cn , toUrl } from '@/lib/utils' ;
3434import { dashboard } from '@/routes' ;
35- import type { BreadcrumbItem , NavItem , SharedData } from '@/types' ;
35+ import type { BreadcrumbItem , NavItem } from '@/types' ;
3636import AppLogo from './app-logo' ;
3737import AppLogoIcon from './app-logo-icon' ;
3838
@@ -65,7 +65,7 @@ const activeItemStyles =
6565 'text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100' ;
6666
6767export function AppHeader ( { breadcrumbs = [ ] } : Props ) {
68- const page = usePage < SharedData > ( ) ;
68+ const page = usePage ( ) ;
6969 const { auth } = page . props ;
7070 const getInitials = useInitials ( ) ;
7171 const { isCurrentUrl, whenCurrentUrl } = useCurrentUrl ( ) ;
Original file line number Diff line number Diff line change 11import { usePage } from '@inertiajs/react' ;
22import type { ReactNode } from 'react' ;
33import { SidebarProvider } from '@/components/ui/sidebar' ;
4- import type { SharedData } from '@/types' ;
54
65type Props = {
76 children : ReactNode ;
87 variant ?: 'header' | 'sidebar' ;
98} ;
109
1110export function AppShell ( { children, variant = 'header' } : Props ) {
12- const isOpen = usePage < SharedData > ( ) . props . sidebarOpen ;
11+ const isOpen = usePage ( ) . props . sidebarOpen ;
1312
1413 if ( variant === 'header' ) {
1514 return (
Original file line number Diff line number Diff line change @@ -14,10 +14,9 @@ import {
1414import { UserInfo } from '@/components/user-info' ;
1515import { UserMenuContent } from '@/components/user-menu-content' ;
1616import { useIsMobile } from '@/hooks/use-mobile' ;
17- import type { SharedData } from '@/types' ;
1817
1918export function NavUser ( ) {
20- const { auth } = usePage < SharedData > ( ) . props ;
19+ const { auth } = usePage ( ) . props ;
2120 const { state } = useSidebar ( ) ;
2221 const isMobile = useIsMobile ( ) ;
2322
Original file line number Diff line number Diff line change 11import { Link , usePage } from '@inertiajs/react' ;
22import AppLogoIcon from '@/components/app-logo-icon' ;
33import { home } from '@/routes' ;
4- import type { AuthLayoutProps , SharedData } from '@/types' ;
4+ import type { AuthLayoutProps } from '@/types' ;
55
66export default function AuthSplitLayout ( {
77 children,
88 title,
99 description,
1010} : AuthLayoutProps ) {
11- const { name } = usePage < SharedData > ( ) . props ;
11+ const { name } = usePage ( ) . props ;
1212
1313 return (
1414 < div className = "relative grid h-dvh flex-col items-center justify-center px-8 sm:px-0 lg:max-w-none lg:grid-cols-2 lg:px-0" >
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import AppLayout from '@/layouts/app-layout';
1111import SettingsLayout from '@/layouts/settings/layout' ;
1212import { edit } from '@/routes/profile' ;
1313import { send } from '@/routes/verification' ;
14- import type { BreadcrumbItem , SharedData } from '@/types' ;
14+ import type { BreadcrumbItem } from '@/types' ;
1515
1616const breadcrumbs : BreadcrumbItem [ ] = [
1717 {
@@ -27,7 +27,7 @@ export default function Profile({
2727 mustVerifyEmail : boolean ;
2828 status ?: string ;
2929} ) {
30- const { auth } = usePage < SharedData > ( ) . props ;
30+ const { auth } = usePage ( ) . props ;
3131
3232 return (
3333 < AppLayout breadcrumbs = { breadcrumbs } >
Original file line number Diff line number Diff line change 11import { Head , Link , usePage } from '@inertiajs/react' ;
22import { dashboard , login , register } from '@/routes' ;
3- import type { SharedData } from '@/types' ;
43
54export default function Welcome ( {
65 canRegister = true ,
76} : {
87 canRegister ?: boolean ;
98} ) {
10- const { auth } = usePage < SharedData > ( ) . props ;
9+ const { auth } = usePage ( ) . props ;
1110
1211 return (
1312 < >
Original file line number Diff line number Diff line change 1+ import type { Auth } from '@/types/auth' ;
2+
3+ declare module '@inertiajs/core' {
4+ export interface InertiaConfig {
5+ sharedPageProps : {
6+ name : string ;
7+ auth : Auth ;
8+ sidebarOpen : boolean ;
9+ [ key : string ] : unknown ;
10+ } ;
11+ }
12+ }
Original file line number Diff line number Diff line change 11export type * from './auth' ;
22export type * from './navigation' ;
33export type * from './ui' ;
4-
5- import type { Auth } from './auth' ;
6-
7- export type SharedData = {
8- name : string ;
9- auth : Auth ;
10- sidebarOpen : boolean ;
11- [ key : string ] : unknown ;
12- } ;
You can’t perform that action at this time.
0 commit comments