feat: 支持视频上传、预览及移动端适配
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit
Some checks failed
test/timeline-frontend/pipeline/head There was a failure building this commit
1. 功能增强: - 支持视频文件的上传、存储及缩略图自动生成 - 新增视频播放组件,支持在画廊和时间线中预览视频 - 引入 STOMP 协议支持 WebSocket 实时通知功能 - 增加分享页面(SSR 友好),支持通过 shareId 访问公开内容 2. 移动端优化: - 新增 BottomNav 底部导航组件,优化移动端交互体验 - 引入 useIsMobile 钩子,实现响应式布局切换 - 优化时间线卡片在小屏幕下的显示效果 3. 架构与组件: - 新增 ClientOnly 组件解决 SSR 激活不一致问题 - 新增 ResponsiveGrid 响应式网格布局组件 - 完善 Nginx 配置,增加 MinIO 对象存储代理 - 优化图片懒加载组件 TimelineImage,支持低分辨率占位图
This commit is contained in:
33
src/components/ResponsiveGrid/index.tsx
Normal file
33
src/components/ResponsiveGrid/index.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import React from 'react';
|
||||
import { Row, Col } from 'antd';
|
||||
|
||||
interface ResponsiveGridProps {
|
||||
children: React.ReactNode;
|
||||
cols?: { [key: string]: number };
|
||||
}
|
||||
|
||||
const ResponsiveGrid: React.FC<ResponsiveGridProps> = ({ children, cols = { xs: 1, sm: 2, md: 3, lg: 4, xl: 6 } }) => {
|
||||
// Helper to calculate span based on columns, ensuring it fits in 24 grid
|
||||
const getSpan = (colCount: number) => {
|
||||
const span = Math.floor(24 / Math.max(1, colCount));
|
||||
return span;
|
||||
};
|
||||
|
||||
const responsiveProps = {
|
||||
xs: getSpan(cols.xs || 1),
|
||||
sm: getSpan(cols.sm || 2),
|
||||
md: getSpan(cols.md || 3),
|
||||
lg: getSpan(cols.lg || 4),
|
||||
xl: getSpan(cols.xl || 6), // Changed default to 6 for clean division (24/6=4)
|
||||
};
|
||||
|
||||
return (
|
||||
<Row gutter={[16, 16]}>
|
||||
{React.Children.map(children, child => (
|
||||
<Col {...responsiveProps}>{child}</Col>
|
||||
))}
|
||||
</Row>
|
||||
);
|
||||
};
|
||||
|
||||
export default ResponsiveGrid;
|
||||
Reference in New Issue
Block a user