diff --git a/src/views/Community/components/DynamicNewsCard.js b/src/views/Community/components/DynamicNewsCard.js index 229973b1..67897c08 100644 --- a/src/views/Community/components/DynamicNewsCard.js +++ b/src/views/Community/components/DynamicNewsCard.js @@ -543,7 +543,7 @@ const [currentMode, setCurrentMode] = useState('vertical'); {/* 左侧:标题 + 模式切换按钮 */} - + 实时要闻·动态追踪 diff --git a/src/views/Community/components/DynamicNewsCard/VerticalModeLayout.js b/src/views/Community/components/DynamicNewsCard/VerticalModeLayout.js index 3101718d..abe9723e 100644 --- a/src/views/Community/components/DynamicNewsCard/VerticalModeLayout.js +++ b/src/views/Community/components/DynamicNewsCard/VerticalModeLayout.js @@ -9,18 +9,12 @@ import { Center, Text, useBreakpointValue, - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalBody, - ModalCloseButton, useDisclosure } from '@chakra-ui/react'; import { InfoIcon } from '@chakra-ui/icons'; import HorizontalDynamicNewsEventCard from '../EventCard/HorizontalDynamicNewsEventCard'; import EventDetailScrollPanel from './EventDetailScrollPanel'; -import DynamicNewsDetailPanel from '../DynamicNewsDetail/DynamicNewsDetailPanel'; +import EventDetailModal from '../EventDetailModal'; /** * 纵向分栏模式布局 @@ -165,20 +159,11 @@ const VerticalModeLayout = React.memo(({ {/* 移动端详情弹窗 */} {isMobile && ( - - - - - {mobileSelectedEvent?.title || '事件详情'} - - - - {mobileSelectedEvent && ( - - )} - - - + )} ); diff --git a/src/views/Community/components/EventDetailModal.less b/src/views/Community/components/EventDetailModal.less new file mode 100644 index 00000000..c448bed8 --- /dev/null +++ b/src/views/Community/components/EventDetailModal.less @@ -0,0 +1,36 @@ +.event-detail-modal { + top: 20% !important; + margin: 0 auto !important; + padding-bottom: 0 !important; + + .ant-modal-content { + border-radius: 24px !important; + background: transparent; + } + + // 标题样式 - 深色文字(白色背景) + .ant-modal-title { + color: #1A202C; + } + + // 关闭按钮样式 - 深色(白色背景) + .ant-modal-close { + color: #4A5568; + + &:hover { + color: #1A202C; + } + } +} + +// 自底向上滑入动画 +@keyframes slideUp { + from { + transform: translateY(100%); + opacity: 0; + } + to { + transform: translateY(0); + opacity: 1; + } +} diff --git a/src/views/Community/components/EventDetailModal.tsx b/src/views/Community/components/EventDetailModal.tsx new file mode 100644 index 00000000..2122a937 --- /dev/null +++ b/src/views/Community/components/EventDetailModal.tsx @@ -0,0 +1,48 @@ +import React from 'react'; +import { useSelector } from 'react-redux'; +import { Modal } from 'antd'; +import { selectIsMobile } from '@store/slices/deviceSlice'; +import DynamicNewsDetailPanel from './DynamicNewsDetail/DynamicNewsDetailPanel'; +import './EventDetailModal.less'; + +interface EventDetailModalProps { + /** 是否打开弹窗 */ + open: boolean; + /** 关闭弹窗回调 */ + onClose: () => void; + /** 事件对象 */ + event: any; // TODO: 后续可替换为具体的 Event 类型 +} + +/** + * 事件详情弹窗组件 + */ +const EventDetailModal: React.FC = ({ + open, + onClose, + event, +}) => { + const isMobile = useSelector(selectIsMobile); + + return ( + + {event && } + + ); +}; + +export default EventDetailModal; diff --git a/src/views/Community/components/HotEvents.js b/src/views/Community/components/HotEvents.js index 8d7411d8..cd403793 100644 --- a/src/views/Community/components/HotEvents.js +++ b/src/views/Community/components/HotEvents.js @@ -2,19 +2,11 @@ import React, { useState } from 'react'; import { Card, Badge, Tag, Empty, Carousel, Tooltip } from 'antd'; import { ArrowUpOutlined, ArrowDownOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons'; -import { - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalBody, - ModalCloseButton, - useDisclosure -} from '@chakra-ui/react'; +import { useDisclosure } from '@chakra-ui/react'; +import EventDetailModal from './EventDetailModal'; import dayjs from 'dayjs'; import './HotEvents.css'; import defaultEventImage from '../../../assets/img/default-event.jpg'; -import DynamicNewsDetailPanel from './DynamicNewsDetail'; // 自定义箭头组件 const CustomArrow = ({ className, style, onClick, direction }) => { @@ -196,21 +188,12 @@ const HotEvents = ({ events, onPageChange, onEventClick }) => { )} - {/* 事件详情弹窗 - 使用 Chakra UI Modal(与平铺模式一致) */} - {isModalOpen ? ( - - - - - {modalEvent?.title || '事件详情'} - - - - {modalEvent && } - - - - ): null} + {/* 事件详情弹窗 */} + ); };