Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ Feat ] router 연결 #14

Merged
merged 10 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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
1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

2 changes: 2 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Global, ThemeProvider } from '@emotion/react';
import styled from '@emotion/styled';
import { useEffect } from 'react';

import { Outlet } from 'react-router-dom';
import globalStyle from './styles/globalStyle';
import theme from './styles/theme';

Expand Down Expand Up @@ -30,6 +31,7 @@ const App = () => {
<Wrapper>
<ThemeProvider theme={theme}>
<Global styles={globalStyle} />
<Outlet />
</ThemeProvider>
</Wrapper>
);
Expand Down
39 changes: 38 additions & 1 deletion src/Router.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
import { RouterProvider, createBrowserRouter } from 'react-router-dom';
import App from './App';
import HomePage from './pages/home/Home';
import JuniorPromisePage from './pages/juniorPromise/JuniorPromise';
import JuniorOnboardingPath from './pages/onboarding/juniorOnboarding/JuniorOnboarding';
import SeniorOnboardingPage from './pages/onboarding/seniorOnboarding/SeniorOnboarding';
import SeniorProfilePage from './pages/seniorProfile/SeniorProfile';

const router = createBrowserRouter([
{
path: '/',
element: <App />,
children: [
{
index: true,
element: <HomePage />,
},
{
path: 'seniorOnboarding',
element: <SeniorOnboardingPage />,
},
{
path: 'juniorOnboarding',
element: <JuniorOnboardingPath />,
},
{
path: 'seniorProfile',
element: <SeniorProfilePage />,
},
{
path: 'juniorPromise',
element: <JuniorPromisePage />,
},
],
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p2) 2차 스프린트로 넘어간 부분이니까 없어도 괜찮을 거 같아요!!

]);

const Router = () => {
return <div>Router</div>;
return <RouterProvider router={router} />;
};

export default Router;
9 changes: 7 additions & 2 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import Router from './Router.tsx';

ReactDOM.createRoot(document.getElementById('root')!).render(<App />);
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<Router />
</React.StrictMode>,
);
5 changes: 5 additions & 0 deletions src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const HomePage = () => {
return <div>Home</div>;
};

export default HomePage;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions src/pages/juniorPromise/JuniorPromise.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const JuniorPromisePage = () => {
return <div>JuniorPromise</div>;
};

export default JuniorPromisePage;
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
5 changes: 0 additions & 5 deletions src/pages/main/Main.tsx

This file was deleted.

5 changes: 5 additions & 0 deletions src/pages/onboarding/juniorOnboarding/JuniorOnboarding.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const JuniorOnboardingPath = () => {
return <div>JuniorOnboarding</div>;
};

export default JuniorOnboardingPath;
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
5 changes: 5 additions & 0 deletions src/pages/onboarding/seniorOnboarding/SeniorOnboarding.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const SeniorOnboardingPage = () => {
return <div>SeniorOnboarding</div>;
};

export default SeniorOnboardingPage;
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
5 changes: 5 additions & 0 deletions src/pages/seniorProfile/SeniorProfile.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const SeniorProfilePage = () => {
return <div>SeniorProfile</div>;
};

export default SeniorProfilePage;
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading