From 7a93a03903b3ae4901fd4aefccbc6685bf8b9db7 Mon Sep 17 00:00:00 2001 From: ShiYu Date: Mon, 19 May 2025 17:34:42 +0800 Subject: [PATCH] feat: enhance mobile responsiveness across settings and image pages --- View/src/pages/allImages/Index.tsx | 110 ++++++------ View/src/pages/pixHub/Index.tsx | 60 +++++-- View/src/pages/pixHub/mockData.ts | 219 ----------------------- View/src/pages/settings/ConfigGroup.tsx | 22 ++- View/src/pages/settings/Index.tsx | 42 ++++- View/src/pages/settings/SystemConfig.tsx | 62 ++++++- View/src/pages/settings/UserProfile.tsx | 45 ++++- 7 files changed, 252 insertions(+), 308 deletions(-) delete mode 100644 View/src/pages/pixHub/mockData.ts diff --git a/View/src/pages/allImages/Index.tsx b/View/src/pages/allImages/Index.tsx index 118b29c..d5488f7 100644 --- a/View/src/pages/allImages/Index.tsx +++ b/View/src/pages/allImages/Index.tsx @@ -1,13 +1,15 @@ import { useState, useRef, useMemo, useCallback } from 'react'; -import { Typography, Button, Dropdown, message } from 'antd'; +import { Typography, Button, Dropdown, message, Row, Col } from 'antd'; import { SortAscendingOutlined, UploadOutlined } from '@ant-design/icons'; import type { PictureResponse } from '../../api'; import ImageUploadDialog from '../../components/upload/ImageUploadDialog'; import ImageGrid from '../../components/image/ImageGrid'; +import useIsMobile from '../../hooks/useIsMobile'; const { Title } = Typography; function AllImages() { + const isMobile = useIsMobile(); const [images, setImages] = useState([]); const [currentPage, setCurrentPage] = useState(1); const [pageSize, setPageSize] = useState(20); @@ -76,60 +78,66 @@ function AllImages() { return ( <>
-
- 所有图片 -
-
- - - - -
+ + + + +
+ + { + const isMobile = useIsMobile(); const [activeCategory, setActiveCategory] = useState('全部'); const [sortBy, setSortBy] = useState('newest'); const [searchQuery, setSearchQuery] = useState(''); @@ -84,28 +86,50 @@ const PixHub: React.FC = () => { return (
-
- +
+ - + <Title level={2} style={{ + marginBottom: 8, + fontWeight: 600, + fontSize: isMobile ? 24 : 30, + textAlign: isMobile ? 'center' : 'left' + }}> 图片广场 - <Text style={{ fontSize: 16, fontWeight: 400, marginLeft: 12, color: '#8c8c8c' }}> + {!isMobile && ( + <Text style={{ fontSize: 16, fontWeight: 400, marginLeft: 12, color: '#8c8c8c' }}> + 探索世界各地的精彩瞬间 + </Text> + )} + + {isMobile && ( + 探索世界各地的精彩瞬间 - - + )} + 发现创作者分享的高质量摄影作品,获取灵感,找到你喜爱的风格 - + } - size="large" + size={isMobile ? "middle" : "large"} onSearch={(value) => setSearchQuery(value)} style={{ width: '100%' }} /> @@ -113,7 +137,7 @@ const PixHub: React.FC = () => { { handleSaveConfig('Storage', 'DefaultStorage', value); }} - style={{ width: 200 }} + style={{ width: isMobile ? '100%' : 200 }} + size={isMobile ? "middle" : "large"} > {storageOptions.map(option => (
-
- 配置存储: +
+ + 配置存储: + @@ -37,7 +57,16 @@ const UserProfile: React.FC = () => { - +