feat: 优化事件中心页面 重构后的文件结构

src/views/Community/
     ├── index.js (主组件,150行左右)
     ├── components/
     │   ├── EventTimelineCard.js (新增)
     │   ├── EventTimelineHeader.js (新增)
     │   ├── EventListSection.js (新增)
     │   ├── HotEventsSection.js (新增)
     │   ├── EventModals.js (新增)
     │   ├── UnifiedSearchBox.js (已有)
     │   ├── EventList.js (已有)
     │   └── ...
     └── hooks/
         ├── useEventFilters.js (新增)
         └── useEventData.js (新增)
This commit is contained in:
zdl
2025-10-26 20:31:34 +08:00
parent f1bd9680b6
commit 97c5ce0d4d
8 changed files with 500 additions and 269 deletions

View File

@@ -0,0 +1,38 @@
// src/views/Community/components/HotEventsSection.js
// 热点事件区域组件
import React from 'react';
import {
Card,
CardHeader,
CardBody,
Heading,
useColorModeValue
} from '@chakra-ui/react';
import HotEvents from './HotEvents';
/**
* 热点事件区域组件
* @param {Array} events - 热点事件列表
*/
const HotEventsSection = ({ events }) => {
const cardBg = useColorModeValue('white', 'gray.800');
// 如果没有热点事件,不渲染组件
if (!events || events.length === 0) {
return null;
}
return (
<Card mt={8} bg={cardBg}>
<CardHeader>
<Heading size="md">🔥 热点事件</Heading>
</CardHeader>
<CardBody>
<HotEvents events={events} />
</CardBody>
</Card>
);
};
export default HotEventsSection;