"use client"; import { useEffect, useState } from "react"; import { ShareIcon } from "@/components/icons"; const DISMISS_KEY = "freezmo.installHintDismissed"; /** * iOS has no `beforeinstallprompt`, so the only way to explain installing the * PWA is to point at the Share sheet. Shown once, only in iOS Safari, only * outside standalone mode. */ export function InstallHint() { const [visible, setVisible] = useState(false); useEffect(() => { try { if (window.localStorage.getItem(DISMISS_KEY) === "1") return; const ua = window.navigator.userAgent; const isIos = /iPad|iPhone|iPod/.test(ua) || (ua.includes("Macintosh") && "ontouchend" in document); const isSafari = /Safari/.test(ua) && !/CriOS|FxiOS|EdgiOS|OPiOS/.test(ua); const standalone = window.matchMedia("(display-mode: standalone)").matches || (window.navigator as unknown as { standalone?: boolean }).standalone === true; if (isIos && isSafari && !standalone) setVisible(true); } catch { /* private mode */ } }, []); if (!visible) return null; const dismiss = () => { setVisible(false); try { window.localStorage.setItem(DISMISS_KEY, "1"); } catch { /* ignore */ } }; return (

Install Freezmo

Tap Share then{" "} Add to Home Screen for a full-screen, app-like experience that works without the browser chrome.

); }