+25
-17
@@ -1,27 +1,35 @@
|
||||
import { createInertiaApp } from "@inertiajs/react";
|
||||
import { Toaster } from "@/components/ui/sonner";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { initializeTheme } from "@/hooks/use-appearance";
|
||||
import AppLayout from "@/layouts/app-layout";
|
||||
import AuthLayout from "@/layouts/auth-layout";
|
||||
import SettingsLayout from "@/layouts/settings/layout";
|
||||
import PortalNavigation from "@/layouts/portal-navigation";
|
||||
import { createInertiaApp } from '@inertiajs/react';
|
||||
import type { ComponentType } from 'react';
|
||||
import { Toaster } from '@/components/ui/sonner';
|
||||
import { TooltipProvider } from '@/components/ui/tooltip';
|
||||
import { initializeTheme } from '@/hooks/use-appearance';
|
||||
import AppLayout from '@/layouts/app-layout';
|
||||
import AuthLayout from '@/layouts/auth-layout';
|
||||
import SettingsLayout from '@/layouts/settings/layout';
|
||||
import PortalNavigation from '@/layouts/portal-navigation';
|
||||
|
||||
const appName = import.meta.env.VITE_APP_NAME || "Laravel";
|
||||
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
|
||||
const pages = import.meta.glob<{ default: ComponentType }>('./pages/**/*.tsx');
|
||||
|
||||
void createInertiaApp({
|
||||
resolve: async (name) => {
|
||||
const path = `./pages/${name}.tsx`;
|
||||
const loadPage = pages[path];
|
||||
if (!loadPage) throw new Error(`Page not found: ${name}`);
|
||||
return (await loadPage()).default;
|
||||
},
|
||||
title: (title) => (title ? `${title} - ${appName}` : appName),
|
||||
layout: (name) => {
|
||||
switch (true) {
|
||||
case name === "welcome":
|
||||
case name === "PortalInvestidor":
|
||||
case name === "management-access":
|
||||
case name.startsWith("portal/"):
|
||||
case name.startsWith("investment/"):
|
||||
case name === 'welcome':
|
||||
case name === 'PortalInvestidor':
|
||||
case name === 'management-access':
|
||||
case name.startsWith('portal/'):
|
||||
case name.startsWith('investment/'):
|
||||
return PortalNavigation;
|
||||
case name.startsWith("auth/"):
|
||||
case name.startsWith('auth/'):
|
||||
return [PortalNavigation, AuthLayout];
|
||||
case name.startsWith("settings/"):
|
||||
case name.startsWith('settings/'):
|
||||
return [PortalNavigation, AppLayout, SettingsLayout];
|
||||
default:
|
||||
return [PortalNavigation, AppLayout];
|
||||
@@ -37,7 +45,7 @@ void createInertiaApp({
|
||||
);
|
||||
},
|
||||
progress: {
|
||||
color: "#4B5563",
|
||||
color: '#4B5563',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user