Skip to content

Commit

Permalink
chore: change page preloader to same as starting (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
shootermv authored Dec 9, 2023
1 parent c293bd6 commit ec095a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const SingleLineMapPage = lazy(() => import('../pages/singleLineMap'))
const About = lazy(() => import('../pages/About'))
const Profile = lazy(() => import('../pages/Profile'))
const BugReportForm = lazy(() => import('../pages/BugReportForm '))
import CircularProgress from '@mui/material/CircularProgress'

import {
RadarChartOutlined,
Expand All @@ -23,6 +22,7 @@ import {
BarChartOutlined,
LineChartOutlined,
} from '@ant-design/icons'
import Preloader from 'src/shared/Preloader'

export const usePages = () => {
const { t } = useTranslation()
Expand Down Expand Up @@ -92,7 +92,7 @@ const RoutesList = () => {
const RedirectToDashboard = () => <Navigate to={pages[0].path} replace />
const routes = pages.filter((r) => r.element)
return (
<Suspense fallback={<CircularProgress />}>
<Suspense fallback={<Preloader />}>
<Routes>
{routes.map(({ path, element }) => (
<Route key={path} path={path} element={element} />
Expand Down
8 changes: 8 additions & 0 deletions src/shared/Preloader.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
const Preloader = () => (
<>
<div className="preloader-bus">🚌</div>
<div className="preloader"></div>
</>
)

export default Preloader

0 comments on commit ec095a5

Please sign in to comment.