diff --git a/src/components/Accordion.tsx b/src/components/Accordion.tsx index a1ec3eea..70145ab9 100644 --- a/src/components/Accordion.tsx +++ b/src/components/Accordion.tsx @@ -17,10 +17,9 @@ const Accordion: React.FC = ({ items }) => { {items.map((item, index) => (
toggleAccordion(index)} + role="button" >
{item.question}
{ const [isLoading, setIsLoading] = useState(true); useEffect(() => { - // Delay for LoadingAnimation - const timer = setTimeout(() => { - setIsLoading(false); - }, 3000); + const handleLoad = () => { + setTimeout(() => { + setIsLoading(false); + }, 1000); // Extra second after load event + }; - return () => clearTimeout(timer); - }, []); + window.addEventListener('load', handleLoad); + + if (document.readyState === 'complete') { + setTimeout(() => { + setIsLoading(false); + }, 1000); + } - if (isLoading) { - return ; - } + return () => window.removeEventListener('load', handleLoad); + }, []); return ( -
- - - - - - - -
+ <> + {isLoading && ( +
+ +
+ )} +
+ + + + + + + +
+ ); };