Skip to content

Commit c87094f

Browse files
authored
Merge pull request #66 from Soohyuniii/feature/화면-가운데-배치-작업
feat: 화면 가운데 배치 작업
2 parents 18d2fb5 + 0dcc0aa commit c87094f

File tree

2 files changed

+28
-10
lines changed

2 files changed

+28
-10
lines changed

src/App.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,24 @@ import ChatTemporature from "@/pages/ChatTemporature";
88
import Content from "@/pages/Content";
99
import Login from "@/pages/Login";
1010
import KaKaoLogin from "@/pages/KaKaoLogin";
11+
import CenteredLayout from "./components/CenteredLayout";
1112

1213
const App = () => {
1314
return (
1415
<Router>
15-
<Routes>
16-
<Route path="/" element={<Home />} />
17-
<Route path="/select-info" element={<SelectInfo />} />
18-
<Route path="/chat" element={<Chat />} />
19-
<Route path="/chat-recommend" element={<ChatRecommend />} />
20-
<Route path="/chat-tips" element={<ChatTips />} />
21-
<Route path="/chat-temporature" element={<ChatTemporature />} />
22-
<Route path="/contents/:id" element={<Content />} />
23-
<Route path="/login" element={<Login />} />
24-
<Route path="/kakao-login" element={<KaKaoLogin />} />{" "}
16+
<CenteredLayout>
17+
<Routes>
18+
<Route path="/" element={<Home />} />
19+
<Route path="/select-info" element={<SelectInfo />} />
20+
<Route path="/chat" element={<Chat />} />
21+
<Route path="/chat-recommend" element={<ChatRecommend />} />
22+
<Route path="/chat-tips" element={<ChatTips />} />
23+
<Route path="/chat-temporature" element={<ChatTemporature />} />
24+
<Route path="/contents/:id" element={<Content />} />
25+
<Route path="/login" element={<Login />} />
26+
<Route path="/kakao-login" element={<KaKaoLogin />} />{" "}
2527
</Routes>
28+
</CenteredLayout>
2629
</Router>
2730
);
2831
};

src/components/CenteredLayout.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { ReactNode } from 'react';
2+
3+
interface CenteredLayoutProps {
4+
children: ReactNode;
5+
}
6+
7+
const CenteredLayout = ({ children }: CenteredLayoutProps) => (
8+
<div className="flex justify-center w-screen">
9+
<div className="w-full flex justify-center">
10+
{children}
11+
</div>
12+
</div>
13+
);
14+
15+
export default CenteredLayout;

0 commit comments

Comments
 (0)