feat: start page after login with workspace grid, login redirect to /start
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import React, { Suspense } from 'react';
|
||||
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
||||
import { AppShell } from '@/components/layout/AppShell';
|
||||
import { StartLayout } from '@/components/layout/StartLayout';
|
||||
import { ProtectedRoute } from './ProtectedRoute';
|
||||
import { ProtectedRoute as PermissionRoute } from '@/components/common/ProtectedRoute';
|
||||
import { LoginPage } from '@/pages/Login';
|
||||
@@ -65,6 +66,7 @@ const SettingsWebhooksPage = React.lazy(() => import('@/pages/SettingsWebhooks')
|
||||
const SettingsBackupPage = React.lazy(() => import('@/pages/SettingsBackup').then(m => ({ default: m.SettingsBackupPage })));
|
||||
const SettingsRechtePage = React.lazy(() => import('@/pages/SettingsRechte').then(m => ({ default: m.SettingsRechtePage })));
|
||||
const NoAccessPage = React.lazy(() => import('@/pages/NoAccessPage').then(m => ({ default: m.NoAccessPage })));
|
||||
const StartPage = React.lazy(() => import('@/pages/StartPage').then(m => ({ default: m.StartPage })));
|
||||
|
||||
/** Centered spinner fallback for lazy-loaded routes */
|
||||
function PageLoader() {
|
||||
@@ -125,6 +127,16 @@ const router = createBrowserRouter([
|
||||
path: '/kein-zugriff',
|
||||
element: <ErrorBoundary>{withSuspense(<NoAccessPage />)}</ErrorBoundary>,
|
||||
},
|
||||
{
|
||||
element: (
|
||||
<ProtectedRoute>
|
||||
<StartLayout />
|
||||
</ProtectedRoute>
|
||||
),
|
||||
children: [
|
||||
{ path: '/start', element: withSuspense(<StartPage />) },
|
||||
],
|
||||
},
|
||||
{
|
||||
element: (
|
||||
<ProtectedRoute>
|
||||
@@ -132,7 +144,7 @@ const router = createBrowserRouter([
|
||||
</ProtectedRoute>
|
||||
),
|
||||
children: [
|
||||
{ path: '/', element: withSuspense(<DashboardPage />) },
|
||||
{ path: '/', element: <Navigate to="/start" replace /> },
|
||||
{ path: '/dashboard', element: withSuspense(<DashboardPage />) },
|
||||
{ path: '/contacts', element: <PermissionRoute permission="contacts:read">{withSuspense(<ContactsListPage />)}</PermissionRoute> },
|
||||
{ path: '/contacts/:id', element: <PermissionRoute permission="contacts:read">{withSuspense(<ContactDetailPage />)}</PermissionRoute> },
|
||||
|
||||
Reference in New Issue
Block a user