Files
Bookra/apps/frontend/src/App.tsx
T
Tomas Dvorak cf3315e8fc
CI / Frontend (push) Successful in 11m7s
CI / Go - apps/auth-service (push) Failing after 8s
CI / Go - apps/backend (push) Failing after 2s
CI / Docker publish - auth-service (push) Has been skipped
CI / Docker publish - backend (push) Has been skipped
cleanup
2026-05-05 09:48:15 +02:00

38 lines
995 B
TypeScript

import type { ParentComponent } from "solid-js";
import { createEffect } from "solid-js";
import { useLocation } from "@solidjs/router";
import { AuthProvider } from "./providers/auth-provider";
import { I18nProvider } from "./providers/i18n-provider";
import { ThemeProvider } from "./providers/theme-provider";
import { Shell } from "./components/shell";
// ScrollToTop component that resets scroll position on route change
const ScrollToTop = () => {
const location = useLocation();
createEffect(() => {
// Reset scroll position whenever the pathname changes
location.pathname;
window.scrollTo({ top: 0, left: 0, behavior: "instant" });
});
return null;
};
const App: ParentComponent = (props) => {
return (
<ThemeProvider>
<I18nProvider>
<AuthProvider>
<Shell>
<ScrollToTop />
{props.children}
</Shell>
</AuthProvider>
</I18nProvider>
</ThemeProvider>
);
};
export default App;