Added installation notification
This commit is contained in:
41
apps/web/src/features/pwa/IosInstallHint.tsx
Normal file
41
apps/web/src/features/pwa/IosInstallHint.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import { Share, X } from 'lucide-react'
|
||||
|
||||
type IosInstallHintProps = {
|
||||
onDismiss: () => void
|
||||
}
|
||||
|
||||
/**
|
||||
* Safari en iOS no expone `beforeinstallprompt`: no hay forma de disparar la
|
||||
* instalación desde la web, hay que instruir al usuario. Solo informa, sin
|
||||
* botón de acción.
|
||||
*/
|
||||
export function IosInstallHint({ onDismiss }: IosInstallHintProps) {
|
||||
return (
|
||||
<div
|
||||
className="fixed inset-x-0 z-30 px-4 lg:left-auto lg:right-6 lg:w-96 lg:px-0
|
||||
bottom-[calc(4.5rem+env(safe-area-inset-bottom))] lg:bottom-6"
|
||||
>
|
||||
<div className="flex items-start gap-3 rounded-xl border border-border bg-surface p-4 shadow-lg">
|
||||
<Share className="mt-0.5 size-5 shrink-0 text-accent" strokeWidth={2} />
|
||||
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="text-sm font-semibold text-primary">Instalá Gruperly en el iPhone</p>
|
||||
<p className="mt-0.5 text-xs leading-relaxed text-foreground/70">
|
||||
Tocá <span className="font-medium text-foreground">Compartir</span> y elegí{' '}
|
||||
<span className="font-medium text-foreground">Agregar a pantalla de inicio</span> para
|
||||
abrirla como app.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onClick={onDismiss}
|
||||
aria-label="Cerrar aviso de instalación"
|
||||
className="shrink-0 rounded-lg p-1 text-foreground/40 transition-colors hover:bg-primary-soft hover:text-foreground"
|
||||
>
|
||||
<X className="size-4" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user