pref: 去掉无用代码
This commit is contained in:
@@ -4,13 +4,9 @@
|
||||
import React, { useRef, useCallback } from 'react';
|
||||
import {
|
||||
Box,
|
||||
Flex,
|
||||
useColorModeValue
|
||||
} from '@chakra-ui/react';
|
||||
import PaginationControl from './PaginationControl';
|
||||
import VirtualizedFourRowGrid from './VirtualizedFourRowGrid';
|
||||
import PageNavigationButton from './PageNavigationButton';
|
||||
import ModeToggleButtons from './ModeToggleButtons';
|
||||
import VerticalModeLayout from './VerticalModeLayout';
|
||||
|
||||
/**
|
||||
@@ -79,32 +75,8 @@ const EventScrollList = ({
|
||||
}
|
||||
}, [onPageChange, currentPage]);
|
||||
|
||||
return (
|
||||
<Box>
|
||||
{/* 横向滚动区域 */}
|
||||
<Box position="relative">
|
||||
|
||||
{/* 翻页导航按钮(平铺模式不显示,使用无限滚动) */}
|
||||
{mode !== 'four-row' && (
|
||||
<>
|
||||
<PageNavigationButton
|
||||
direction="prev"
|
||||
currentPage={currentPage}
|
||||
totalPages={totalPages}
|
||||
onPageChange={onPageChange}
|
||||
mode={mode}
|
||||
/>
|
||||
<PageNavigationButton
|
||||
direction="next"
|
||||
currentPage={currentPage}
|
||||
totalPages={totalPages}
|
||||
onPageChange={onPageChange}
|
||||
mode={mode}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
{/* 事件卡片容器 */}
|
||||
return (
|
||||
<Box
|
||||
ref={scrollContainerRef}
|
||||
overflowX="hidden"
|
||||
@@ -134,8 +106,8 @@ const EventScrollList = ({
|
||||
}}
|
||||
>
|
||||
{/* 平铺网格模式 - 使用虚拟滚动 + 双向无限滚动 */}
|
||||
{mode === 'four-row' && (
|
||||
<VirtualizedFourRowGrid
|
||||
display={mode === 'four-row' ? 'block' : 'none'}
|
||||
columnsPerRow={4} // 每行显示4列
|
||||
events={displayEvents || events} // 使用累积列表(如果有)
|
||||
selectedEvent={selectedEvent}
|
||||
@@ -151,11 +123,10 @@ const EventScrollList = ({
|
||||
error={error} // 错误状态
|
||||
onRetry={handleRetry} // 重试回调
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* 纵向分栏模式 */}
|
||||
{mode === 'vertical' && (
|
||||
<VerticalModeLayout
|
||||
display={mode === 'vertical' ? 'block' : 'none'}
|
||||
events={events}
|
||||
selectedEvent={selectedEvent}
|
||||
onEventSelect={onEventSelect}
|
||||
@@ -167,9 +138,6 @@ const EventScrollList = ({
|
||||
totalPages={totalPages}
|
||||
onPageChange={onPageChange}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user