Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
},
"dependencies": {
"react": "^19.2.0",
"react-dom": "^19.2.0"
"react-dom": "^19.2.0",
"react-router": "^7.9.6"
},
"devDependencies": {
"vite-tsconfig-paths": "^5.1.4",
"@eslint/js": "^9.39.1",
"@types/node": "^24.10.0",
"@types/react": "^19.2.2",
Expand All @@ -27,6 +27,7 @@
"globals": "^16.5.0",
"typescript": "~5.9.3",
"typescript-eslint": "^8.46.3",
"vite": "^7.2.2"
"vite": "^7.2.2",
"vite-tsconfig-paths": "^5.1.4"
}
}
32 changes: 32 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion src/app/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
import { router } from "@shared/router/router";
import { RouterProvider } from "react-router";

function App() {
return <div>티켓베이 파이팅~</div>;
return (
// @TODO: global 테마 추가
// <ThemeProvider>

// @TODO: 쿼리 클라이언트 추가
// <QueryClientProvider client={queryClient}>
<RouterProvider router={router} />
// <ReactQueryDevtools initialIsOpen={false} />
// </QueryClientProvider>

// </ThemeProvider>
);
}

export default App;
6 changes: 5 additions & 1 deletion src/pages/ticket-detail/ticket-detail.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { useParams } from "react-router";

const TicketDetail = () => {
return <div>TicketDetail</div>;
const { ticketId } = useParams();

return <div>TicketDetail-{ticketId}</div>;
};

export default TicketDetail;
Empty file removed src/shared/router/.gitkeep
Empty file.
13 changes: 13 additions & 0 deletions src/shared/router/global-layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Suspense } from "react";
import { Outlet, ScrollRestoration } from "react-router";

export default function GlobalLayout() {
return (
<>
<Suspense fallback={null}>
<Outlet />
</Suspense>
<ScrollRestoration />
</>
);
}
10 changes: 10 additions & 0 deletions src/shared/router/lazy.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { lazy } from "react";

export const HomePage = lazy(() => import("@pages/home/home"));

export const SelectTicketPage = lazy(
() => import("@pages/select-ticket/select-ticket")
);
export const TicketDetailPage = lazy(
() => import("@pages/ticket-detail/ticket-detail")
);
7 changes: 7 additions & 0 deletions src/shared/router/path.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const routePath = {
HOME: "/",
SELECT_TICKET: "/select-ticket",
TICKET_DETAIL: "/ticket-detail/:ticketId",
} as const;

export type Routes = (typeof routePath)[keyof typeof routePath];
11 changes: 11 additions & 0 deletions src/shared/router/router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { createBrowserRouter } from "react-router";

import { globalRoutes } from "@shared/router/routes/global-routes";
import GlobalLayout from "@shared/router/global-layout";

export const router = createBrowserRouter([
{
Component: GlobalLayout,
children: [...globalRoutes],
},
]);
21 changes: 21 additions & 0 deletions src/shared/router/routes/global-routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {
HomePage,
SelectTicketPage,
TicketDetailPage,
} from "@shared/router/lazy";
import { routePath } from "@shared/router/path";

export const globalRoutes = [
{
path: routePath.HOME,
element: <HomePage />,
},
{
path: routePath.SELECT_TICKET,
element: <SelectTicketPage />,
},
{
path: routePath.TICKET_DETAIL,
element: <TicketDetailPage />,
},
];