♻️ refactor(App): move loading screen to standalone component

This commit is contained in:
2025-05-28 10:36:44 +00:00
parent 585aed9233
commit ece4c49ab9
2 changed files with 10 additions and 6 deletions
+1 -6
View File
@@ -3,6 +3,7 @@ import { createBrowserRouter, RouterProvider } from 'react-router-dom'
import ErrorPage from 'components/pages/ErrorPage/index.js' import ErrorPage from 'components/pages/ErrorPage/index.js'
import RootLayout from 'components/templates/RouteTracker/index.js' import RootLayout from 'components/templates/RouteTracker/index.js'
import Loading from 'components/molecules/LoadingScreen/index.js'
const MainPage = React.lazy(() => import('components/pages/MainPage/index.js')) const MainPage = React.lazy(() => import('components/pages/MainPage/index.js'))
const ProjectsPage = React.lazy(() => import('components/pages/ProjectsPage/index.js')) const ProjectsPage = React.lazy(() => import('components/pages/ProjectsPage/index.js'))
@@ -10,12 +11,6 @@ const CurriculumPage = React.lazy(() => import('components/pages/CurriculumPage/
const ContactPage = React.lazy(() => import('components/pages/ContactPage/index.js')) const ContactPage = React.lazy(() => import('components/pages/ContactPage/index.js'))
const PrivacyPage = React.lazy(() => import('components/pages/PrivacyPage/index.js')) const PrivacyPage = React.lazy(() => import('components/pages/PrivacyPage/index.js'))
const Loading = () => (
<Backdrop open={true} aria-label="loading-screen">
<CircularProgress />
</Backdrop>
)
const router = createBrowserRouter([ const router = createBrowserRouter([
{ {
path: '/', path: '/',
@@ -0,0 +1,9 @@
import { Backdrop, CircularProgress } from '@mui/material'
const Loading = () => (
<Backdrop open={true} aria-label="loading-screen">
<CircularProgress />
</Backdrop>
)
export default Loading