Skip to content

Commit

Permalink
Merge branch 'main' into fix/157/horizontal-padding-seems-not-align-i…
Browse files Browse the repository at this point in the history
…n-every-section
  • Loading branch information
teoh4770 authored Mar 27, 2024
2 parents be20803 + 5c9f92f commit 953f8df
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 21 deletions.
5 changes: 2 additions & 3 deletions src/components/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ const Accordion: React.FC<AccordionProps> = ({ items }) => {
{items.map((item, index) => (
<div key={index} className="w-full">
<div
className={`cursor-pointer flex justify-between items-center p-4 bg-white border-black rounded-xl border ${
activeIndex === index ? 'rounded-b-none' : ''
}`}
className={`cursor-pointer flex justify-between items-center p-4 bg-white border-black rounded-xl border select-none ${activeIndex === index ? 'rounded-b-none' : ''}`}
onClick={() => toggleAccordion(index)}
role="button"
>
<h6 className="text-black">{item.question}</h6>
<span
Expand Down
48 changes: 30 additions & 18 deletions src/pages/Landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,40 @@ const Landing: React.FC = () => {
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 <LoadingAnimation />;
}
return () => window.removeEventListener('load', handleLoad);
}, []);

return (
<div className="pt-[5rem] transition ease-in">
<Navbar />
<HeroStatSection />
<SponsorFAQSection />
<TeamSection />
<ContactSection />
<FooterSection />
<ScrollButton />
</div>
<>
{isLoading && (
<div className="loading-overlay">
<LoadingAnimation />
</div>
)}
<div className={`pt-[5rem] transition ease-in ${isLoading ? 'hidden' : 'block'}`}>
<Navbar />
<HeroStatSection />
<SponsorFAQSection />
<TeamSection />
<ContactSection />
<FooterSection />
<ScrollButton />
</div>
</>
);
};

Expand Down

0 comments on commit 953f8df

Please sign in to comment.