update ui

This commit is contained in:
2025-11-13 23:24:54 +08:00
parent d3b980b3ca
commit 3caa5f4c3a
7 changed files with 179 additions and 63 deletions

View File

@@ -45,6 +45,7 @@ import {
} from '../../../store/slices/communityDataSlice';
import { usePagination } from './DynamicNewsCard/hooks/usePagination';
import { PAGINATION_CONFIG, DISPLAY_MODES } from './DynamicNewsCard/constants';
import { PROFESSIONAL_COLORS } from '../../../constants/professionalTheme';
// 🔍 调试:渲染计数器
let dynamicNewsCardRenderCount = 0;
@@ -74,8 +75,8 @@ const DynamicNewsCard = forwardRef(({
}, ref) => {
const dispatch = useDispatch();
const toast = useToast();
const cardBg = useColorModeValue('white', 'gray.800');
const borderColor = useColorModeValue('gray.200', 'gray.700');
const cardBg = PROFESSIONAL_COLORS.background.card;
const borderColor = PROFESSIONAL_COLORS.border.default;
// 通知权限相关
const { browserPermission, requestBrowserPermission } = useNotification();
@@ -409,10 +410,10 @@ const [currentMode, setCurrentMode] = useState('vertical');
{/* 第一行:标题 + 通知开关 + 更新时间 */}
<Flex justify="space-between" align="center">
{/* 左侧:标题 */}
<Heading size="md">
<Heading size="md" color={PROFESSIONAL_COLORS.text.primary}>
<HStack spacing={2}>
<TimeIcon />
<Text>实时要闻·动态追踪</Text>
<TimeIcon color={PROFESSIONAL_COLORS.gold[500]} />
<Text bgGradient={PROFESSIONAL_COLORS.gradients.gold} bgClip="text">实时要闻·动态追踪</Text>
</HStack>
</Heading>
@@ -473,7 +474,7 @@ const [currentMode, setCurrentMode] = useState('vertical');
</Tooltip>
{/* 更新时间 */}
<Text fontSize="xs" color="gray.500" whiteSpace="nowrap">
<Text fontSize="xs" color={PROFESSIONAL_COLORS.text.secondary} whiteSpace="nowrap">
最后更新: {lastUpdateTime?.toLocaleTimeString() || '--'}
</Text>
</HStack>
@@ -542,7 +543,7 @@ const [currentMode, setCurrentMode] = useState('vertical');
left={0}
right={0}
bottom={0}
bg={useColorModeValue('rgba(255, 255, 255, 0.85)', 'rgba(26, 32, 44, 0.85)')}
bg="rgba(26, 31, 46, 0.95)"
display="flex"
alignItems="center"
justifyContent="center"
@@ -550,8 +551,8 @@ const [currentMode, setCurrentMode] = useState('vertical');
borderRadius="md"
>
<VStack spacing={3}>
<Spinner size="xl" color="blue.500" thickness="4px" />
<Text color={useColorModeValue('gray.600', 'gray.300')} fontWeight="medium">
<Spinner size="xl" color={PROFESSIONAL_COLORS.gold[500]} thickness="4px" />
<Text color={PROFESSIONAL_COLORS.text.primary} fontWeight="medium">
正在加载最新事件...
</Text>
</VStack>