diff --git a/components/SettingModal.tsx b/components/SettingModal.tsx index 47468f2..89fe98c 100644 --- a/components/SettingModal.tsx +++ b/components/SettingModal.tsx @@ -1,7 +1,7 @@ -import { Popover } from "@mui/material"; import { useState } from "react"; import { createPortal } from "react-dom"; import Icon from "./Icon"; +import WeChatQRCodeView from "./WeChatQRCodeView"; import ClearDataConfirmModal from "./ClearDataConfirmModal"; interface Props { @@ -18,8 +18,6 @@ const SettingModal = (props: Props) => { const [state, setState] = useState({ showClearDataConfirmModal: false, }); - const [wechatAnchorEl, setWeChatAnchorEl] = useState(null); - const openWeChatQrCodePopover = Boolean(wechatAnchorEl); const toggleClearDataConfirmModal = (show = true) => { setState({ @@ -46,24 +44,7 @@ const SettingModal = (props: Props) => { Join Discord Channel -
setWeChatAnchorEl(e.currentTarget)} - > - - Join WeChat Group -
- setWeChatAnchorEl(null)} - anchorOrigin={{ - vertical: "bottom", - horizontal: "left", - }} - > - - +

Danger Zone

diff --git a/components/WeChatQRCodeView.tsx b/components/WeChatQRCodeView.tsx new file mode 100644 index 0000000..da91030 --- /dev/null +++ b/components/WeChatQRCodeView.tsx @@ -0,0 +1,33 @@ +import { Popover } from "@mui/material"; +import { useState } from "react"; +import Icon from "./Icon"; + +const WeChatQRCodeView = () => { + const [wechatAnchorEl, setWeChatAnchorEl] = useState(null); + const openWeChatQrCodePopover = Boolean(wechatAnchorEl); + + return ( + <> +
setWeChatAnchorEl(e.currentTarget)} + > + + Join WeChat Group +
+ setWeChatAnchorEl(null)} + anchorOrigin={{ + vertical: "bottom", + horizontal: "left", + }} + > + wechat qrcode + + + ); +}; + +export default WeChatQRCodeView;