File tree Expand file tree Collapse file tree 2 files changed +28
-10
lines changed
Expand file tree Collapse file tree 2 files changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,23 @@ import ChatTips from "@/pages/ChatTips";
77import ChatTemporature from "@/pages/ChatTemporature" ;
88import Content from "@/pages/Content" ;
99import Login from "@/pages/Login" ;
10+ import CenteredLayout from "./components/CenteredLayout" ;
1011
1112const 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} ;
Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments