Skip to content

Commit

Permalink
#46 feat: router 설계
Browse files Browse the repository at this point in the history
  • Loading branch information
wuzoo committed Jul 8, 2024
1 parent 7bc7c29 commit 4d7695d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
38 changes: 38 additions & 0 deletions src/common/router/Router.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// 회원가입 -> signin/terms | signin/info
// archiving
// showcase
import App from '@/App';

import { RouterProvider, createBrowserRouter } from 'react-router-dom';

const router = createBrowserRouter([
{
path: '/',
element: <App />,
children: [
{ path: 'showcase', element: <p>showcase</p> },
{ path: 'archiving', element: <p>archiving</p> },
{
path: 'signin',
element: <p>terms</p>,
},
{
path: 'signin/info',
element: <p>info</p>,
},
{
path: 'password/auth',
element: <p>인증</p>,
},
{
path: 'password/reset',
element: <p>재설정</p>,
},
],
},
]);

export const AppRouter = () => {
return <RouterProvider router={router} />;
};
5 changes: 2 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ import { createRoot } from 'react-dom/client';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';

import { AppRouter } from '@/common/router/Router';
import { globalStyle } from '@/common/style/globalStyle';
import { theme } from '@/common/style/theme/theme';

import { worker } from '@/mock/browser';

import App from './App';

const queryClient = new QueryClient();

const main = async () => {
Expand All @@ -31,7 +30,7 @@ const main = async () => {
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>
<Global styles={globalStyle} />
<App />
<AppRouter />
</ThemeProvider>
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
Expand Down

0 comments on commit 4d7695d

Please sign in to comment.