Skip to content

Commit 58fb5c3

Browse files
Merge pull request #366 from boostcampwm-2024/refactor-fe-#356
프론트엔드 리팩토링
2 parents 67c650c + cc3bad1 commit 58fb5c3

File tree

104 files changed

+628
-568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+628
-568
lines changed

apps/frontend/public/icons/vite.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/frontend/src/app/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { useSyncedUsers } from "@/entities/user";
2-
import { SideWrapper } from "@/shared/ui";
2+
import { useGetUser } from "@/features/auth";
3+
import { CanvasToolsView } from "@/widgets/CanvasToolsView";
34
import { CanvasView } from "@/widgets/CanvasView";
45
import { EditorView } from "@/widgets/EditorView";
56
import { PageSideBarView } from "@/widgets/PageSideBarView";
6-
import { CanvasToolsView } from "@/widgets/CanvasToolsView";
7-
import { useGetUser } from "@/features/auth/model/useAuth";
7+
import { SideWrapper } from "@/shared/ui";
88

99
function App() {
1010
useSyncedUsers();

apps/frontend/src/app/main.tsx

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import { StrictMode } from "react";
22
import { createRoot } from "react-dom/client";
3-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4-
import { RouterProvider, createRouter } from "@tanstack/react-router";
53
import "../shared/index.css";
6-
import { routeTree } from "@/routeTree.gen";
7-
8-
const queryClient = new QueryClient();
9-
10-
const router = createRouter({ routeTree });
11-
declare module "@tanstack/react-router" {
12-
interface Register {
13-
router: typeof router;
14-
}
15-
}
4+
import { TanstackQueryProvider } from "./providers/TanstackQueryProvider";
5+
import { TanstackRouterProvider } from "./providers/TanstackRouterProvider";
166

177
createRoot(document.getElementById("root")!).render(
188
<StrictMode>
19-
<QueryClientProvider client={queryClient}>
20-
<RouterProvider router={router} />
21-
</QueryClientProvider>
9+
<TanstackQueryProvider>
10+
<TanstackRouterProvider />
11+
</TanstackQueryProvider>
2212
</StrictMode>,
2313
);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
2+
3+
const queryClient = new QueryClient();
4+
5+
export function TanstackQueryProvider({
6+
children,
7+
}: {
8+
children: React.ReactNode;
9+
}) {
10+
return (
11+
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
12+
);
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { RouterProvider, createRouter } from "@tanstack/react-router";
2+
import { routeTree } from "@/app/routeTree.gen";
3+
4+
const router = createRouter({ routeTree });
5+
declare module "@tanstack/react-router" {
6+
interface Register {
7+
router: typeof router;
8+
}
9+
}
10+
11+
export function TanstackRouterProvider() {
12+
return <RouterProvider router={router} />;
13+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/* eslint-disable */
2+
3+
// @ts-nocheck
4+
5+
// noinspection JSUnusedGlobalSymbols
6+
7+
// This file was automatically generated by TanStack Router.
8+
// You should NOT make any changes in this file as it will be overwritten.
9+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
10+
11+
// Import Routes
12+
13+
import { Route as rootRoute } from "./routes/__root";
14+
import { Route as IndexImport } from "./routes/index";
15+
import { Route as WorkspaceWorkspaceIdImport } from "./routes/workspace/$workspaceId";
16+
17+
// Create/Update Routes
18+
19+
const IndexRoute = IndexImport.update({
20+
id: "/",
21+
path: "/",
22+
getParentRoute: () => rootRoute,
23+
} as any);
24+
25+
const WorkspaceWorkspaceIdRoute = WorkspaceWorkspaceIdImport.update({
26+
id: "/workspace/$workspaceId",
27+
path: "/workspace/$workspaceId",
28+
getParentRoute: () => rootRoute,
29+
} as any);
30+
31+
// Populate the FileRoutesByPath interface
32+
33+
declare module "@tanstack/react-router" {
34+
interface FileRoutesByPath {
35+
"/": {
36+
id: "/";
37+
path: "/";
38+
fullPath: "/";
39+
preLoaderRoute: typeof IndexImport;
40+
parentRoute: typeof rootRoute;
41+
};
42+
"/workspace/$workspaceId": {
43+
id: "/workspace/$workspaceId";
44+
path: "/workspace/$workspaceId";
45+
fullPath: "/workspace/$workspaceId";
46+
preLoaderRoute: typeof WorkspaceWorkspaceIdImport;
47+
parentRoute: typeof rootRoute;
48+
};
49+
}
50+
}
51+
52+
// Create and export the route tree
53+
54+
export interface FileRoutesByFullPath {
55+
"/": typeof IndexRoute;
56+
"/workspace/$workspaceId": typeof WorkspaceWorkspaceIdRoute;
57+
}
58+
59+
export interface FileRoutesByTo {
60+
"/": typeof IndexRoute;
61+
"/workspace/$workspaceId": typeof WorkspaceWorkspaceIdRoute;
62+
}
63+
64+
export interface FileRoutesById {
65+
__root__: typeof rootRoute;
66+
"/": typeof IndexRoute;
67+
"/workspace/$workspaceId": typeof WorkspaceWorkspaceIdRoute;
68+
}
69+
70+
export interface FileRouteTypes {
71+
fileRoutesByFullPath: FileRoutesByFullPath;
72+
fullPaths: "/" | "/workspace/$workspaceId";
73+
fileRoutesByTo: FileRoutesByTo;
74+
to: "/" | "/workspace/$workspaceId";
75+
id: "__root__" | "/" | "/workspace/$workspaceId";
76+
fileRoutesById: FileRoutesById;
77+
}
78+
79+
export interface RootRouteChildren {
80+
IndexRoute: typeof IndexRoute;
81+
WorkspaceWorkspaceIdRoute: typeof WorkspaceWorkspaceIdRoute;
82+
}
83+
84+
const rootRouteChildren: RootRouteChildren = {
85+
IndexRoute: IndexRoute,
86+
WorkspaceWorkspaceIdRoute: WorkspaceWorkspaceIdRoute,
87+
};
88+
89+
export const routeTree = rootRoute
90+
._addFileChildren(rootRouteChildren)
91+
._addFileTypes<FileRouteTypes>();
92+
93+
/* ROUTE_MANIFEST_START
94+
{
95+
"routes": {
96+
"__root__": {
97+
"filePath": "__root.tsx",
98+
"children": [
99+
"/",
100+
"/workspace/$workspaceId"
101+
]
102+
},
103+
"/": {
104+
"filePath": "index.tsx"
105+
},
106+
"/workspace/$workspaceId": {
107+
"filePath": "workspace/$workspaceId.tsx"
108+
}
109+
}
110+
}
111+
ROUTE_MANIFEST_END */

0 commit comments

Comments
 (0)