Skip to content

Commit ecc62a5

Browse files
committed
feat: 화면 가운데 배치 작업
1 parent b45b4f5 commit ecc62a5

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
@@ -7,20 +7,23 @@ import ChatTips from "@/pages/ChatTips";
77
import ChatTemporature from "@/pages/ChatTemporature";
88
import Content from "@/pages/Content";
99
import Login from "@/pages/Login";
10+
import CenteredLayout from "./components/CenteredLayout";
1011

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

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)