cookie and pwa stuff

This commit is contained in:
yohlo
2026-02-14 12:59:01 -06:00
parent 236fcda671
commit 6e9e014fcc
11 changed files with 180 additions and 24 deletions

15
src/hooks/use-is-pwa.ts Normal file
View File

@@ -0,0 +1,15 @@
import { useEffect, useState } from 'react'
export function useIsPWA(): boolean {
const [isPWA, setIsPWA] = useState(false)
useEffect(() => {
const isStandalone = window.matchMedia('(display-mode: standalone)').matches
const isIOSStandalone = 'standalone' in window.navigator && (window.navigator as any).standalone
setIsPWA(isStandalone || isIOSStandalone)
}, [])
return isPWA
}