update ui

This commit is contained in:
2025-11-14 06:39:29 +08:00
parent 1773c571ab
commit 5e70f4443d
5 changed files with 88 additions and 46 deletions

View File

@@ -2,7 +2,7 @@
// 纵向分栏模式布局组件
import React, { useState } from 'react';
import { Box, VStack, Flex, Center, Text } from '@chakra-ui/react';
import { Box, VStack, Flex, Center, Text, useBreakpointValue } from '@chakra-ui/react';
import { InfoIcon } from '@chakra-ui/icons';
import HorizontalDynamicNewsEventCard from '../EventCard/HorizontalDynamicNewsEventCard';
import EventDetailScrollPanel from './EventDetailScrollPanel';
@@ -33,6 +33,11 @@ const VerticalModeLayout = ({
// 详情面板重置 key预留用于未来功能
const [detailPanelKey] = useState(0);
// 响应式布局
const isMobile = useBreakpointValue({ base: true, lg: false });
const flexDirection = useBreakpointValue({ base: 'column', lg: 'row' });
const gap = useBreakpointValue({ base: 3, lg: 6 });
// 固定布局比例左侧4右侧6- 平衡布局,确保左侧有足够空间显示内容
const leftFlex = '4';
const rightFlex = '6';
@@ -40,7 +45,8 @@ const VerticalModeLayout = ({
return (
<Flex
display={display}
gap={6}
direction={flexDirection}
gap={gap}
position="relative"
transition="all 0.3s ease-in-out"
h="100%"
@@ -48,8 +54,9 @@ const VerticalModeLayout = ({
>
{/* 左侧:事件列表 - 独立滚动 */}
<Box
flex={leftFlex}
flex={isMobile ? '1' : leftFlex}
minWidth={0}
w={isMobile ? '100%' : 'auto'}
overflowY="auto"
h="100%"
data-event-list-container="true"
@@ -109,21 +116,23 @@ const VerticalModeLayout = ({
)}
</Box>
{/* 右侧:事件详情 - 独立滚动 */}
<Box
flex={rightFlex}
minHeight={0}
position="relative"
overflow="hidden"
h="100%"
>
{/* 详情面板 */}
<EventDetailScrollPanel
key={detailPanelKey}
detailMode="no-header"
selectedEvent={selectedEvent}
/>
</Box>
{/* 右侧:事件详情 - 独立滚动 - 移动端隐藏 */}
{!isMobile && (
<Box
flex={rightFlex}
minHeight={0}
position="relative"
overflow="hidden"
h="100%"
>
{/* 详情面板 */}
<EventDetailScrollPanel
key={detailPanelKey}
detailMode="no-header"
selectedEvent={selectedEvent}
/>
</Box>
)}
</Flex>
);
};