"use client"; import React, { useState, useEffect } from "react"; import { Image } from "antd-mobile"; import { get,save } from "@/utils/storeInfo"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faClose } from "@fortawesome/free-solid-svg-icons"; export default function AddToHome() { const [firstLogin, setFirstLogin] = useState({ first: "0", second: false }); useEffect(() => { if (!("standalone" in window.navigator && window.navigator.standalone)) { setFirstLogin((old) => ({ ...old, first: get("firstLogin") })); } }, []); return firstLogin.first == "1" ? (
{!firstLogin.second ? (

建议您添加铁粉空间 到手机桌面

以便随时关注圈子动态

setFirstLogin((old) => ({ ...old, second: true }))} > 去添加
{ save("firstLogin", 0); setFirstLogin((old) => ({ first: "0", second: false })); }} />
) : (
{ save("firstLogin", 0); setFirstLogin((old) => ({ first: "0", second: false })); }} >
点击 添加到主屏幕
)}
) : null; }