mirror of
https://github.com/Dvorinka/Bookra.git
synced 2026-10-29 07:54:44 +00:00
cleanup
This commit is contained in:
1 parent
d854614a87
commit
48c3e15a38
295 files changed
+178378
-1036
No files matched your search
+31
-15
@@ -1,21 +1,37 @@
|
||||
import { Route } from "@solidjs/router";
|
||||
import type { ParentComponent } from "solid-js";
|
||||
import { createEffect, onMount } 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";
|
||||
import { DashboardRoute } from "./routes/dashboard-route";
|
||||
import { HomeRoute } from "./routes/home-route";
|
||||
import { PublicBookingRoute } from "./routes/public-booking-route";
|
||||
|
||||
export default function App() {
|
||||
// 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 (
|
||||
<I18nProvider>
|
||||
<AuthProvider>
|
||||
<Shell>
|
||||
<Route path="/" component={HomeRoute} />
|
||||
<Route path="/dashboard" component={DashboardRoute} />
|
||||
<Route path="/book/:tenantSlug" component={PublicBookingRoute} />
|
||||
</Shell>
|
||||
</AuthProvider>
|
||||
</I18nProvider>
|
||||
<ThemeProvider>
|
||||
<I18nProvider>
|
||||
<AuthProvider>
|
||||
<Shell>
|
||||
<ScrollToTop />
|
||||
{props.children}
|
||||
</Shell>
|
||||
</AuthProvider>
|
||||
</I18nProvider>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default App;
|
||||
Reference in new issue
Block a user