diff --git a/client/src/app/routes/index.tsx b/client/src/app/routes/index.tsx index f6cbde5..b40af29 100644 --- a/client/src/app/routes/index.tsx +++ b/client/src/app/routes/index.tsx @@ -1,22 +1,34 @@ +import { lazy, Suspense } from 'react' import { Navigate, Route, Routes } from 'react-router-dom' import { MainLayout } from '@/app/layout/MainLayout' import { AboutPage } from '@/pages/about' -import { AdminLayoutPage } from '@/pages/admin-layout' +// import { AdminLayoutPage } from '@/pages/admin-layout' import { AuthCallbackPage, AuthPage } from '@/pages/auth' import { CartPage } from '@/pages/cart' import { CheckoutPage } from '@/pages/checkout' import { HomePage } from '@/pages/home' import { InfoPage } from '@/pages/info' -import { MeLayoutPage } from '@/pages/me' +// import { MeLayoutPage } from '@/pages/me' import { PrivacyPolicyPage } from '@/pages/privacy-policy' import { ProductPage } from '@/pages/product' +import { SkeletonPage } from '@/shared/ui/SkeletonPage' + +const AdminLayoutPage = lazy(() => import('@/pages/admin-layout').then((m) => ({ default: m.AdminLayoutPage }))) +const MeLayoutPage = lazy(() => import('@/pages/me').then((m) => ({ default: m.MeLayoutPage }))) export function AppRoutes() { return ( } /> - } /> + }> + + + } + /> } /> } /> } /> @@ -24,7 +36,14 @@ export function AppRoutes() { } /> } /> } /> - } /> + }> + + + } + /> } /> } /> diff --git a/client/src/shared/ui/SkeletonPage.tsx b/client/src/shared/ui/SkeletonPage.tsx new file mode 100644 index 0000000..ecefa97 --- /dev/null +++ b/client/src/shared/ui/SkeletonPage.tsx @@ -0,0 +1,14 @@ +import Box from '@mui/material/Box' +import Skeleton from '@mui/material/Skeleton' + +export function SkeletonPage() { + return ( + + + + + + + + ) +}