fix: 移动端事件中心事件列表添加时间
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
import { getImportanceConfig } from '../../../../constants/importanceLevels';
|
||||
import { PROFESSIONAL_COLORS } from '../../../../constants/professionalTheme';
|
||||
import { useDevice } from '@hooks/useDevice';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
// 导入子组件
|
||||
import ImportanceStamp from './ImportanceStamp';
|
||||
@@ -161,6 +162,33 @@ const HorizontalDynamicNewsEventCard = React.memo(({
|
||||
onClick={() => onEventClick?.(event)}
|
||||
>
|
||||
<CardBody p={cardPadding} pb={2}>
|
||||
{/* 左上角:移动端时间显示 */}
|
||||
{isMobile && (
|
||||
<Box
|
||||
position="absolute"
|
||||
top={1}
|
||||
left={1}
|
||||
zIndex={2}
|
||||
{...(timelineStyle.bgGradient ? { bgGradient: timelineStyle.bgGradient } : { bg: timelineStyle.bg })}
|
||||
borderWidth={timelineStyle.borderWidth}
|
||||
borderColor={timelineStyle.borderColor}
|
||||
borderRadius="md"
|
||||
px={1.5}
|
||||
py={1}
|
||||
textAlign="center"
|
||||
boxShadow={timelineStyle.boxShadow}
|
||||
>
|
||||
<Text
|
||||
fontSize="9px"
|
||||
fontWeight="bold"
|
||||
color={timelineStyle.textColor}
|
||||
lineHeight="1.2"
|
||||
>
|
||||
{dayjs(event.created_at).format('MM-DD HH:mm')}
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{/* 右上角:关注按钮 */}
|
||||
<Box position="absolute" top={{ base: 1, md: 2 }} right={{ base: 1, md: 2 }} zIndex={2}>
|
||||
<EventFollowButton
|
||||
@@ -202,6 +230,7 @@ const HorizontalDynamicNewsEventCard = React.memo(({
|
||||
onClick={(e) => onTitleClick?.(e, event)}
|
||||
mt={1}
|
||||
paddingRight={titlePaddingRight}
|
||||
paddingLeft={isMobile ? '70px' : undefined}
|
||||
>
|
||||
<Text
|
||||
fontSize={titleFontSize}
|
||||
|
||||
Reference in New Issue
Block a user