Skip to content

Commit dd4fbe8

Browse files
committed
fix: routing and types
1 parent a14755f commit dd4fbe8

File tree

17 files changed

+25
-215
lines changed

17 files changed

+25
-215
lines changed

apps/web/src/core/auth/UseAuth.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { usePostLoginMutate, usePostLogoutMutate } from "@package/api";
44
import { AuthContext } from "./AuthContext";
55
import type { AuthStatus } from "./AuthReducer";
66

7+
export type { AuthStatus };
8+
79
export function useAuth(): {
810
status: AuthStatus;
911
login(data: LoginData): Promise<void>;

apps/web/src/core/routes/AppRoutes.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
import type { ReactElement } from "react";
2+
import type { QueryClient } from "@tanstack/react-query";
23
import { useQueryClient } from "@tanstack/react-query";
34
import { RouterProvider, createHashHistory, createRouter } from "@tanstack/react-router";
4-
import { useAuth } from "../auth/UseAuth";
55
import { routeTree } from "../../routeTree.gen";
6+
import { useAuth } from "../auth/UseAuth";
7+
import type { AuthStatus } from "../auth/UseAuth";
68

79
const hashHistory = createHashHistory();
810

11+
export interface RouterContext {
12+
queryClient: QueryClient;
13+
authStatus: AuthStatus;
14+
}
15+
916
const router = createRouter({
1017
routeTree,
1118
history: hashHistory,
1219
context: {
1320
queryClient: undefined!,
1421
authStatus: undefined!,
15-
},
22+
} as RouterContext,
1623
defaultPreload: "intent",
1724
defaultPreloadStaleTime: 0,
1825
});

apps/web/src/core/routes/PrivateRoutes.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

apps/web/src/core/routes/PublicRoutes.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

apps/web/src/core/routes/logic/PrivateRouteLogic.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

apps/web/src/core/routes/logic/PublicRouteLogic.tsx

Lines changed: 0 additions & 28 deletions
This file was deleted.

apps/web/src/pages/about/AboutRoute.tsx

Lines changed: 0 additions & 25 deletions
This file was deleted.

apps/web/src/pages/about/modal/AboutModalRoute.tsx

Lines changed: 0 additions & 31 deletions
This file was deleted.

apps/web/src/pages/forgot-password/UseForgotPasswordPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { addToast } from "@heroui/react";
22
import { usePostForgotPasswordMutate } from "@package/api";
3-
import { useIntl } from "react-intl";
43
import { useNavigate } from "@tanstack/react-router";
4+
import { useIntl } from "react-intl";
55
import type { FormForgotPassword } from "~/components/forms/forgot-password/ForgotPasswordForm";
66
import type { ForgotPasswordViewProps } from "~/components/views/forgot-password/ForgotPasswordView";
77
import { useAppInfo } from "~/core/config/UseAppInfo";

apps/web/src/pages/home/HomeRoute.tsx

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)