The styling for various components including site navigation and the site header has been updated. Changes include amendments to layout options, color, spacing, and border adaptations to provide better visibility and user interaction. The shadow on the top loading bar indicator has also been relocated to enhance the bar's visibility.
39 lines
766 B
TypeScript
39 lines
766 B
TypeScript
'use client';
|
|
|
|
import { createRef, useEffect, useRef } from 'react';
|
|
|
|
import type { LoadingBarRef } from 'react-top-loading-bar';
|
|
import LoadingBar from 'react-top-loading-bar';
|
|
|
|
export function TopLoadingBarIndicator() {
|
|
const ref = createRef<LoadingBarRef>();
|
|
const runningRef = useRef(false);
|
|
|
|
useEffect(() => {
|
|
if (!ref.current || runningRef.current) {
|
|
return;
|
|
}
|
|
|
|
const loadingBarRef = ref.current;
|
|
|
|
loadingBarRef.continuousStart(0, 250);
|
|
runningRef.current = true;
|
|
|
|
return () => {
|
|
loadingBarRef.complete();
|
|
runningRef.current = false;
|
|
};
|
|
}, [ref]);
|
|
|
|
return (
|
|
<LoadingBar
|
|
className={'bg-primary'}
|
|
height={4}
|
|
waitingTime={0}
|
|
shadow
|
|
color={''}
|
|
ref={ref}
|
|
/>
|
|
);
|
|
}
|