feat: Refresh token on load and user information added

This commit is contained in:
مهرزاد قدرتی
2025-08-17 13:00:25 +03:30
parent dd6e2fdd0d
commit 3410c52656
13 changed files with 137 additions and 47 deletions

View File

@@ -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