Skip to content

Commit dd2f31b

Browse files
committed
feat: 优化导航和首页用户体验
- 在App.tsx中添加'我的Profile'导航菜单 - 配置Profile管理页面路由 - 在Home.tsx中添加社区交流区域 - 将关于页面的加群信息复制到首页 - 提高社区信息的可见性和用户参与度 - 保持一致的设计风格和响应式布局
1 parent c89287b commit dd2f31b

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

src/App.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ThemeProvider, createTheme, AppBar, Toolbar, Container, styled } from '
44
import Home from './pages/Home';
55
import PromptTemplate from './pages/PromptTemplate';
66
import About from './pages/About';
7+
import ProfilesPage from './pages/ProfilesPage';
78

89
// 创建自定义主题
910
const theme = createTheme({
@@ -86,6 +87,9 @@ function NavLinks() {
8687
<StyledLink to="/prompt" className={isActive('/prompt') ? 'active' : ''}>
8788
提示词构建
8889
</StyledLink>
90+
<StyledLink to="/profiles" className={isActive('/profiles') ? 'active' : ''}>
91+
我的Profile
92+
</StyledLink>
8993
<StyledLink to="/about" className={isActive('/about') ? 'active' : ''}>
9094
关于我们
9195
</StyledLink>
@@ -117,6 +121,7 @@ function MainApp() {
117121
<Routes>
118122
<Route path="/" element={<Home />} />
119123
<Route path="/prompt" element={<PromptTemplate />} />
124+
<Route path="/profiles" element={<ProfilesPage />} />
120125
<Route path="/about" element={<About />} />
121126
</Routes>
122127

src/pages/Home.tsx

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ import { Container, Grid, Card, CardContent, Typography, Button, Box, useTheme }
33
import { Link } from 'react-router-dom';
44
import RocketLaunchIcon from '@mui/icons-material/RocketLaunch';
55
import TrackChangesIcon from '@mui/icons-material/TrackChanges';
6+
import MessageIcon from '@mui/icons-material/Message';
7+
import QQIcon from '@mui/icons-material/QuestionAnswer';
68
import { styled } from '@mui/system';
79
import './Home.css';
10+
import wechatQR from '../assets/cc11001100-weixin.png';
11+
import qqQR from '../assets/qq-group-qrcode.jpg';
812

913
// 修复后的FeatureCard样式组件
1014
const FeatureCard = styled(Card)(({ theme }) => ({
@@ -193,6 +197,113 @@ export default function Home() {
193197
</Grid>
194198
</Grid>
195199

200+
{/* 社区交流区域 */}
201+
<Box sx={{
202+
mb: 8,
203+
p: 4,
204+
backgroundColor: 'background.paper',
205+
borderRadius: 4,
206+
boxShadow: 1
207+
}}>
208+
<Typography variant="h4" gutterBottom sx={{
209+
fontWeight: 700,
210+
color: 'primary.main',
211+
textAlign: 'center',
212+
mb: 4
213+
}}>
214+
🤖 加入AI社区
215+
</Typography>
216+
<Typography variant="body1" sx={{
217+
textAlign: 'center',
218+
color: 'text.secondary',
219+
mb: 4,
220+
fontSize: '1.1rem'
221+
}}>
222+
与更多AI开发者交流经验,获取最新技术动态和使用技巧
223+
</Typography>
224+
225+
<Grid container spacing={4} justifyContent="center">
226+
<Grid item xs={12} sm={6} md={4}>
227+
<Box sx={{
228+
p: 3,
229+
border: '1px solid',
230+
borderColor: 'divider',
231+
borderRadius: 2,
232+
textAlign: 'center',
233+
transition: 'all 0.3s',
234+
'&:hover': {
235+
transform: 'translateY(-4px)',
236+
boxShadow: 3
237+
}
238+
}}>
239+
<MessageIcon sx={{fontSize: 40, color: '#09b83e', mb: 2}}/>
240+
<Typography variant="h6" gutterBottom>
241+
微信交流群
242+
</Typography>
243+
<img
244+
src={wechatQR}
245+
alt="微信二维码"
246+
style={{
247+
width: 150,
248+
height: 210,
249+
margin: '0 auto 16px',
250+
display: 'block',
251+
borderRadius: 8
252+
}}
253+
/>
254+
<Typography variant="body2" color="text.secondary">
255+
扫码添加好友,备注"大模型"申请入群
256+
</Typography>
257+
</Box>
258+
</Grid>
259+
260+
<Grid item xs={12} sm={6} md={4}>
261+
<Box sx={{
262+
p: 3,
263+
border: '1px solid',
264+
borderColor: 'divider',
265+
borderRadius: 2,
266+
textAlign: 'center',
267+
transition: 'all 0.3s',
268+
'&:hover': {
269+
transform: 'translateY(-4px)',
270+
boxShadow: 3
271+
}
272+
}}>
273+
<QQIcon sx={{fontSize: 40, color: '#12b7f5', mb: 2}}/>
274+
<Typography variant="h6" gutterBottom>
275+
QQ交流群
276+
</Typography>
277+
<img
278+
src={qqQR}
279+
alt="QQ群二维码"
280+
style={{
281+
width: 150,
282+
height: 200,
283+
margin: '0 auto 16px',
284+
display: 'block',
285+
borderRadius: 8
286+
}}
287+
/>
288+
<Button
289+
variant="contained"
290+
href="https://qm.qq.com/q/pYBa99j1e2"
291+
target="_blank"
292+
sx={{
293+
mt: 1,
294+
borderRadius: 20,
295+
px: 4,
296+
bgcolor: '#12b7f5',
297+
'&:hover': {bgcolor: '#0f9cd3'}
298+
}}
299+
>
300+
一键加群
301+
</Button>
302+
</Box>
303+
</Grid>
304+
</Grid>
305+
</Box>
306+
196307
{/* CTA区域 */}
197308
<Box sx={{
198309
textAlign: 'center',

0 commit comments

Comments
 (0)