diff --git a/src/components/NotificationPermissionContorl.tsx b/src/components/NotificationPermissionContorl.tsx index 6bea30b..4c6b936 100644 --- a/src/components/NotificationPermissionContorl.tsx +++ b/src/components/NotificationPermissionContorl.tsx @@ -1,6 +1,6 @@ -import { Button, Flex, Form, Switch, Typography } from "antd"; +import { Button, Drawer, Flex, Form, Switch, Typography } from "antd"; import { useNotificationControl } from "../hooks/useNotificationControl"; -import { useCallback } from "react"; +import { useCallback, useState } from "react"; const NotificationPermissionControl = () => { const { @@ -10,36 +10,58 @@ const NotificationPermissionControl = () => { handleDisableNotificationClick, handleEnableNotificationClick, } = useNotificationControl(); + const [open, setOpen] = useState(false); const showEnableNotification = useCallback(() => { - + setOpen(true); }, []); return ( - - {isSupported ? ( - { - if (checked) { - handleEnableNotificationClick(); - } else { - handleDisableNotificationClick(); - } - }} - /> - ) : ( - - - 当前模式不支持通知功 - - - - )} - + <> + + {isSupported ? ( + { + if (checked) { + handleEnableNotificationClick(); + } else { + handleDisableNotificationClick(); + } + }} + /> + ) : ( + + + 当前模式不支持通知功 + + + + )} + + setOpen(false)} + title={'帮助'} + > + + 1. 使用系统默认浏览器打开本网站 + + + iOS 设备使用 Safari 浏览器 + + + 2. 点击分享 + + + 3. 点击添加到主屏幕 + + + 4. 从主屏幕的应用中打开网站进行设置 + + + ); }; diff --git a/src/components/PermissionControlPanel.tsx b/src/components/PermissionControlPanel.tsx index 2b6d66f..fb50d0d 100644 --- a/src/components/PermissionControlPanel.tsx +++ b/src/components/PermissionControlPanel.tsx @@ -10,6 +10,7 @@ const PermissionControlPanel = () => { setOpen(false)} >