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