first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:52:23 +03:00
commit 880f412e2c
2662 changed files with 866266 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import { useRouter } from "@tanstack/react-router";
import { BProgress } from "@bprogress/core";
import { useEffect } from "react";
/**
* App-wide top progress bar driven by TanStack Router navigation events.
* Replaces @bprogress/next/app, which only worked with the Next.js router.
*
* Subscribes to the router's pending state via subscribe() and toggles the
* @bprogress/core bar accordingly.
*/
const AppProgressProvider = ({ children }: { children: React.ReactNode }) => {
const router = useRouter();
useEffect(() => {
BProgress.configure({ showSpinner: false, minimum: 0.1 });
const unsubBefore = router.subscribe("onBeforeLoad", () => {
BProgress.start();
});
const unsubLoad = router.subscribe("onLoad", () => {
BProgress.done();
});
return () => {
unsubBefore();
unsubLoad();
};
}, [router]);
return <>{children}</>;
};
export default AppProgressProvider;