diff --git a/rsconcept/frontend/src/app/ApplicationLayout.tsx b/rsconcept/frontend/src/app/ApplicationLayout.tsx
index 67471bef..1576f056 100644
--- a/rsconcept/frontend/src/app/ApplicationLayout.tsx
+++ b/rsconcept/frontend/src/app/ApplicationLayout.tsx
@@ -1,7 +1,6 @@
import { Suspense } from 'react';
-import { Outlet, useNavigation } from 'react-router';
+import { Outlet } from 'react-router';
-import { Loader } from '@/components/Loader';
import { ModalLoader } from '@/components/Modal';
import { useAppLayoutStore, useMainHeight, useViewportHeight } from '@/stores/appLayout';
import { globals } from '@/utils/constants';
@@ -15,8 +14,6 @@ import { GlobalTooltips } from './GlobalTooltips';
import { Navigation } from './Navigation';
function ApplicationLayout() {
- const navigation = useNavigation();
-
const mainHeight = useMainHeight();
const viewportHeight = useViewportHeight();
const showScroll = useAppLayoutStore(state => !state.noScroll);
@@ -50,10 +47,8 @@ function ApplicationLayout() {
}}
>
- {navigation.state === 'loading' ? : null}
- }>
-
-
+
+
{!noNavigation && !noFooter ? : null}
diff --git a/rsconcept/frontend/src/app/GlobalLoader.tsx b/rsconcept/frontend/src/app/GlobalLoader.tsx
index 6de4a369..91b3a04d 100644
--- a/rsconcept/frontend/src/app/GlobalLoader.tsx
+++ b/rsconcept/frontend/src/app/GlobalLoader.tsx
@@ -1,8 +1,20 @@
+import { useNavigation } from 'react-router';
import clsx from 'clsx';
+import { useDebounce } from 'use-debounce';
import { Loader } from '@/components/Loader';
+import { PARAMETER } from '@/utils/constants';
export function GlobalLoader() {
+ const navigation = useNavigation();
+
+ const isLoading = navigation.state === 'loading';
+ const [loadingDebounced] = useDebounce(isLoading, PARAMETER.navigationPopupDelay);
+
+ if (!loadingDebounced || !isLoading) {
+ return null;
+ }
+
return (
diff --git a/rsconcept/frontend/src/app/Router.tsx b/rsconcept/frontend/src/app/Router.tsx
index 1a5836f9..4e7dcaf9 100644
--- a/rsconcept/frontend/src/app/Router.tsx
+++ b/rsconcept/frontend/src/app/Router.tsx
@@ -23,7 +23,7 @@ export const Router = createBrowserRouter([
element:
,
errorElement:
,
loader: prefetchAuth,
- hydrateFallbackElement:
,
+ hydrateFallbackElement: fallbackLoader(),
children: [
{
path: '',
@@ -99,3 +99,11 @@ function parseRSFormURL(id: string | undefined, url: string) {
function parseOssURL(id: string | undefined) {
return { itemID: id ? Number(id) : undefined };
}
+
+function fallbackLoader() {
+ return (
+
+
+
+ );
+}
diff --git a/rsconcept/frontend/src/utils/constants.ts b/rsconcept/frontend/src/utils/constants.ts
index fce4ae8c..b04dcf1e 100644
--- a/rsconcept/frontend/src/utils/constants.ts
+++ b/rsconcept/frontend/src/utils/constants.ts
@@ -12,6 +12,7 @@ export const PARAMETER = {
minimalTimeout: 10, // milliseconds delay for fast updates
zoomDuration: 500, // milliseconds animation duration
navigationDuration: 300, // milliseconds navigation duration
+ navigationPopupDelay: 200, // milliseconds delay for navigation popup
ossImageWidth: 1280, // pixels - size of OSS image
ossImageHeight: 960, // pixels - size of OSS image