feat: Refresh token on load and user information added
This commit is contained in:
@@ -2,6 +2,7 @@ import { Suspense, type ReactNode } from 'react';
|
||||
import { createBrowserRouter, type RouteObject } from 'react-router-dom';
|
||||
import { appRoutes, type RouteConfig } from './config';
|
||||
import { ProtectedRoute } from '@/components/ProtectedRoute';
|
||||
import { Loading } from '@/components/Loading';
|
||||
|
||||
/**
|
||||
* A recursive function to map our custom route config to the format
|
||||
@@ -11,7 +12,7 @@ function mapRoutes(routes: RouteConfig[]): RouteObject[] {
|
||||
return routes.map((route) => {
|
||||
// Start with the base element, wrapped in Suspense for lazy loading
|
||||
let element: ReactNode = (
|
||||
<Suspense fallback={<div>Loading...</div>}>{route.element}</Suspense>
|
||||
<Suspense fallback={<Loading />}>{route.element}</Suspense>
|
||||
);
|
||||
|
||||
// Conditionally wrap the element in the specified layout
|
||||
|
||||
Reference in New Issue
Block a user