feat: feat: 优化事件卡片 UI 和交互体验

修复 useColorModeValue 调用位置(提升到顶层)
优化分页和滚动逻辑
动态 indicatorSize 支持(detail/list 模式)
This commit is contained in:
zdl
2025-11-05 19:15:36 +08:00
parent 27b68e928e
commit 612b58c983
4 changed files with 66 additions and 68 deletions

View File

@@ -5,8 +5,7 @@ import { useSelector, useDispatch } from 'react-redux';
import {
fetchPopularKeywords,
fetchHotEvents,
fetchDynamicNews,
selectDynamicNewsWithLoading
fetchDynamicNews
} from '../../store/slices/communityDataSlice';
import {
Box,
@@ -39,13 +38,6 @@ const Community = () => {
// Redux状态
const { popularKeywords, hotEvents } = useSelector(state => state.communityData);
const {
data: allCachedEvents,
loading: dynamicNewsLoading,
error: dynamicNewsError,
total: dynamicNewsTotal,
cachedCount: dynamicNewsCachedCount
} = useSelector(selectDynamicNewsWithLoading);
// Chakra UI hooks
const bgColor = useColorModeValue('gray.50', 'gray.900');
@@ -167,10 +159,6 @@ const Community = () => {
{/* 实时要闻·动态追踪 - 横向滚动 */}
<DynamicNewsCard
mt={6}
allCachedEvents={allCachedEvents}
loading={dynamicNewsLoading}
total={dynamicNewsTotal}
cachedCount={dynamicNewsCachedCount}
filters={filters}
popularKeywords={popularKeywords}
lastUpdateTime={lastUpdateTime}