feat: H5 移动端将隐藏"开启通知"组件,桌面端保持正常显示

This commit is contained in:
zdl
2025-11-26 16:01:58 +08:00
parent 022271947a
commit 217551b6ab

View File

@@ -47,6 +47,7 @@ import { usePagination } from './DynamicNewsCard/hooks/usePagination';
import { PAGINATION_CONFIG, DISPLAY_MODES, REFRESH_DEBOUNCE_DELAY } from './DynamicNewsCard/constants';
import { PROFESSIONAL_COLORS } from '../../../constants/professionalTheme';
import { debounce } from '../../../utils/debounce';
import { useDevice } from '@hooks/useDevice';
// 🔍 调试:渲染计数器
let dynamicNewsCardRenderCount = 0;
@@ -81,6 +82,7 @@ const DynamicNewsCardComponent = forwardRef(({
// 通知权限相关
const { browserPermission, requestBrowserPermission } = useNotification();
const { isMobile } = useDevice();
// Refs
const cardHeaderRef = useRef(null);
@@ -548,7 +550,8 @@ const [currentMode, setCurrentMode] = useState('vertical');
{/* 右侧:通知开关 + 更新时间 */}
<HStack spacing={3}>
{/* 通知开关 */}
{/* 通知开关 - 移动端隐藏 */}
{!isMobile && (
<Tooltip
label={browserPermission === 'granted'
? '浏览器通知已开启'
@@ -601,6 +604,7 @@ const [currentMode, setCurrentMode] = useState('vertical');
/>
</HStack>
</Tooltip>
)}
{/* 更新时间 */}
<Text fontSize="xs" color={PROFESSIONAL_COLORS.text.secondary} whiteSpace="nowrap">