Skip to content

Commit

Permalink
feat: 공통 레이아웃 적용을 위해 라우팅 구조 변경 #47
Browse files Browse the repository at this point in the history
- 기존: DM 페이지와 커뮤니티 페이지는 별개의 페이지로 Gnb를 공유하지 않았음
- 변경 후: DM 페이지와 커뮤니티 페이지를 `/` 경로 아래에 두어 Gnb를 공유하게 됨
  • Loading branch information
leegwae committed Nov 15, 2022
1 parent 4186d9e commit 4c0e832
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
23 changes: 12 additions & 11 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ import { Route, Routes } from 'react-router-dom';

const App = () => (
<Routes>
<Route path="/" element={<Home />} />
<Route path="/" element={<Home />}>
<Route path="dms" element={<DM />}>
<Route path="followings" element={<Followings />} />
<Route path="followers" element={<Followers />} />
<Route path="user-search" element={<UserSearch />} />
<Route path=":roomId" element={<DMRoom />} />
</Route>
<Route
path="communities/:communityId/channels/:roomId"
element={<Community />}
/>
</Route>
<Route path="/sign-in" element={<SignIn />} />
<Route path="/sign-up" element={<SignUp />} />
<Route path="/dms" element={<DM />}>
<Route path="followings" element={<Followings />} />
<Route path="followers" element={<Followers />} />
<Route path="user-search" element={<UserSearch />} />
<Route path=":roomId" element={<DMRoom />} />
</Route>
<Route
path="/communities/:communityId/channels/:roomId"
element={<Community />}
/>
<Route path="*" element={<NotFound />} />
</Routes>
);
Expand Down
7 changes: 6 additions & 1 deletion client/src/pages/DM/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react';
import { Outlet } from 'react-router-dom';

const DM = () => {
return <div>DM</div>;
return (
<>
<Outlet />
</>
);
};

export default DM;
7 changes: 6 additions & 1 deletion client/src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React from 'react';
import { Outlet } from 'react-router-dom';

const Home = () => {
return <div></div>;
return (
<>
<Outlet />
</>
);
};

export default Home;

0 comments on commit 4c0e832

Please sign in to comment.