♻️ refactor(App): move loading screen to standalone component
This commit is contained in:
+1
-6
@@ -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
|
||||||
Reference in New Issue
Block a user