Skip to content

Commit

Permalink
Merge pull request #14 from TEAM-SEONYAK/feat/#13/router
Browse files Browse the repository at this point in the history
[ Feat ] router 연결
  • Loading branch information
lydiacho authored Jul 7, 2024
2 parents 71afafb + 9b5fdbc commit 5b999ac
Show file tree
Hide file tree
Showing 35 changed files with 73 additions and 9 deletions.
1 change: 0 additions & 1 deletion public/vite.svg

This file was deleted.

3 changes: 3 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 All @@ -38,6 +40,7 @@ const App = () => {
export default App;

const Wrapper = styled.div`
width: 100vw;
min-height: calc(var(--vh, 1vh) * 100);
border: none;
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 />,
},
],
},
]);

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.

0 comments on commit 5b999ac

Please sign in to comment.