-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2653 from Amsterdam/bugfix/performance-improvement
Updated png and lazy loading for better performance
- Loading branch information
Showing
26 changed files
with
80 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,43 @@ | ||
import React from "react" | ||
import React, { Suspense } from "react" | ||
import { Routes, Route } from "react-router-dom" | ||
|
||
import routes from "app/config/routes" | ||
import ProtectedRoute from "./components/ProtectedRoute" | ||
import NotFoundPage from "../components/pages/NotFoundPage" | ||
import CenteredSpinner from "app/features/shared/components/atoms/CenteredSpinner/CenteredSpinner" | ||
|
||
const allowList = /^\/login|^\/authentication\/|^\/auth/ | ||
|
||
const Router: React.FC = () => ( | ||
<Routes> | ||
{ | ||
// Pages that do NOT match the allowList are protected | ||
Object | ||
.entries(routes) | ||
.filter(([ path ]) => !path.match(allowList)) | ||
.map(([ path, Page ]) => ( | ||
// <ProtectedRoute page={ Page } key={ path } path={ path } /> | ||
<Route | ||
key={path} | ||
path={path} | ||
element={<ProtectedRoute page={Page} />} | ||
/> | ||
)) | ||
} | ||
{ | ||
// Pages that do match the allowList are NOT protected | ||
Object | ||
.entries(routes) | ||
.filter(([ path ]) => path.match(allowList)) | ||
.map(([ path, Page ]) => ( | ||
// <Page key={ path } path={ path } /> | ||
<Route key={path} path={path} element={<Page />} /> | ||
)) | ||
} | ||
<Route path="*" element={<NotFoundPage />} /> | ||
</Routes> | ||
<Suspense fallback={<CenteredSpinner explanation="Even geduld…" size={ 60 }/>}> | ||
<Routes> | ||
{ | ||
// Pages that do NOT match the allowList are protected | ||
Object | ||
.entries(routes) | ||
.filter(([ path ]) => !path.match(allowList)) | ||
.map(([ path, Page ]) => ( | ||
// <ProtectedRoute page={ Page } key={ path } path={ path } /> | ||
<Route | ||
key={path} | ||
path={path} | ||
element={<ProtectedRoute page={Page} />} | ||
/> | ||
)) | ||
} | ||
{ | ||
// Pages that do match the allowList are NOT protected | ||
Object | ||
.entries(routes) | ||
.filter(([ path ]) => path.match(allowList)) | ||
.map(([ path, Page ]) => ( | ||
// <Page key={ path } path={ path } /> | ||
<Route key={path} path={path} element={<Page />} /> | ||
)) | ||
} | ||
<Route path="*" element={<NotFoundPage />} /> | ||
</Routes> | ||
</Suspense> | ||
) | ||
|
||
export default Router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters