diff --git a/src/components/PrivateRoute.tsx b/src/components/PrivateRoute.tsx index b6efb13..7a1697c 100644 --- a/src/components/PrivateRoute.tsx +++ b/src/components/PrivateRoute.tsx @@ -2,13 +2,13 @@ import React from 'react'; import { Navigate } from 'react-router-dom'; import { useAuth } from '@contexts/AuthContext'; -import { SkeletonAllBooks } from '@components/skeletons/SkeletonABooks'; +import { SkeletonMain } from '@components/skeletons/SkeletonMain'; export function PrivateRoute({ children }: { children: React.ReactNode }) { const { currentUser, loading } = useAuth(); if (loading) { - return ; + return ; } return currentUser ? <>{children} : ; diff --git a/src/components/skeletons/SkeletonMain.tsx b/src/components/skeletons/SkeletonMain.tsx new file mode 100644 index 0000000..a2dfb7c --- /dev/null +++ b/src/components/skeletons/SkeletonMain.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +import { Skeleton, Stack } from '@chakra-ui/react'; + +export function SkeletonMain() { + return ( + <> + + + + + + ); +} diff --git a/src/pages/layout/Layout.tsx b/src/pages/layout/Layout.tsx index d929dfc..8cc202c 100644 --- a/src/pages/layout/Layout.tsx +++ b/src/pages/layout/Layout.tsx @@ -1,7 +1,7 @@ import React, { Suspense } from 'react'; import { Outlet } from 'react-router-dom'; -import { Skeleton, Stack } from '@chakra-ui/react'; +import { SkeletonMain } from '@components/skeletons/SkeletonMain'; import { Nav } from '@components/nav/Nav'; import { Footer } from '@components/Footer'; import { ScrollToTop } from '@utils/ScrollToTop'; @@ -11,14 +11,7 @@ export function Layout() { <>