Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #28

Merged
merged 2 commits into from
Oct 23, 2024
Merged

Dev #28

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ export default async function RootLayout({
{/* <LoaderProvider> */}
<GlobalStatus />
<Header />
<LoaderProvider>{children}</LoaderProvider>
<Footer />
<LoaderProvider>
{children}
<Footer />
</LoaderProvider>
{/* </LoaderProvider> */}
</ColorProvider>
</ThemeProvider>
Expand Down
10 changes: 5 additions & 5 deletions components/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ function Hero() {
</div> */}
<Section className="z-10 flex max-lg:flex-col items-center justify-between gap-6 min-h-[calc(100vh-400px)] max-lg:pt-8 max-lg:pb-8 max-md:pt-4 max-md:mx-auto">
<div className="flex-[3] flex flex-col gap-2">
<h1 className="drop-shadow-lg font-caption text-6xl font-bold text-primary max-md:text-4xl max-sm:text-3xl max-xl:text-6xl max-lg:text-5xl">
<h1 className="drop-shadow-lg font-caption text-7xl font-bold text-primary max-md:text-4xl max-sm:text-3xl max-xl:text-6xl max-lg:text-5xl">
{hero?.titleIntro}
<br />
<span className="text-7xl max-md:text-4xl">
{hero?.titleMain}
</span>
<span className="">{hero?.titleMain}</span>
<br />
<span className="text-white">{hero?.titleOutro}</span>
<span className="text-white text-6xl max-md:text-4xl">
{hero?.titleOutro}
</span>
</h1>
<h2 className="font-caption font-extralight text-xl max-sm:text-xl text-white">
{hero?.subFirst}
Expand Down
4 changes: 2 additions & 2 deletions components/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function ProgressBar({ onComplete }: ProgressBarProps) {
} else {
setTimeout(() => {
setVisible(false);
onComplete(); // Appeler la fonction de complétion ici
onComplete();
}, 200);
}
};
Expand All @@ -42,7 +42,7 @@ export function ProgressBar({ onComplete }: ProgressBarProps) {
return () => {
cancelAnimationFrame(animationFrameId);
};
}, [onComplete]); // Ajoutez onComplete comme dépendance
}, [onComplete]);

return (
visible && (
Expand Down
8 changes: 6 additions & 2 deletions context/LoaderContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ export const useLoader = (): LoaderContextType => {

export const LoaderProvider = ({ children }: { children: ReactNode }) => {
const [isLoading, setIsLoading] = useState<boolean>(false);
const [hasLoaded, setHasLoaded] = useState<boolean>(false);

const showLoader = () => {
setIsLoading(true);
if (!hasLoaded) {
setIsLoading(true);
}
};

const hideLoader = () => {
const timeout = setTimeout(() => {
setIsLoading(false);
}, 1500);
setHasLoaded(true);
}, 2000);
return () => clearTimeout(timeout);
};

Expand Down