mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-24 15:22:20 +10:00
v5.1.0 (#2970)
* chore(release): v5.1.0 * feat: implement resume thumbnails * fix: remove unused mcp tools * docs: fix formatting of docs
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import { createRouter } from "@tanstack/react-router";
|
||||
import { setupRouterSsrQueryIntegration } from "@tanstack/react-router-ssr-query";
|
||||
import { ErrorScreen } from "./components/layout/error-screen";
|
||||
import { LoadingScreen } from "./components/layout/loading-screen";
|
||||
import { NotFoundScreen } from "./components/layout/not-found-screen";
|
||||
import { getSession } from "./libs/auth/session";
|
||||
import { getLocale, loadLocale } from "./libs/locale";
|
||||
import { client, orpc } from "./libs/orpc/client";
|
||||
import { getQueryClient } from "./libs/query/client";
|
||||
import { getTheme } from "./libs/theme";
|
||||
import { routeTree } from "./routeTree.gen";
|
||||
|
||||
export const getRouter = async () => {
|
||||
const queryClient = getQueryClient();
|
||||
|
||||
const [theme, locale, session, flags] = await Promise.all([
|
||||
getTheme(),
|
||||
getLocale(),
|
||||
getSession(),
|
||||
client.flags.get(),
|
||||
]);
|
||||
|
||||
await loadLocale(locale);
|
||||
|
||||
const router = createRouter({
|
||||
routeTree,
|
||||
scrollRestoration: true,
|
||||
defaultPreload: "intent",
|
||||
defaultViewTransition: true,
|
||||
defaultStructuralSharing: true,
|
||||
defaultErrorComponent: ErrorScreen,
|
||||
defaultPendingComponent: LoadingScreen,
|
||||
defaultNotFoundComponent: NotFoundScreen,
|
||||
context: { orpc, queryClient, theme, locale, session, flags },
|
||||
});
|
||||
|
||||
setupRouterSsrQueryIntegration({
|
||||
router,
|
||||
queryClient,
|
||||
handleRedirects: true,
|
||||
wrapQueryClient: true,
|
||||
});
|
||||
|
||||
return router;
|
||||
};
|
||||
Reference in New Issue
Block a user