45 lines
1.6 KiB
TypeScript
45 lines
1.6 KiB
TypeScript
import { Download, X } from 'lucide-react'
|
|
import { Button } from '../../components/ui'
|
|
|
|
type InstallBannerProps = {
|
|
onInstall: () => void
|
|
onDismiss: () => void
|
|
}
|
|
|
|
export function InstallBanner({ onInstall, onDismiss }: InstallBannerProps) {
|
|
return (
|
|
<div
|
|
className="fixed inset-x-0 z-30 px-4 lg:left-auto lg:right-6 lg:w-96 lg:px-0
|
|
// Encima de BottomNav en móvil; abajo a la derecha en desktop.
|
|
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">
|
|
<div className="min-w-0 flex-1">
|
|
<p className="text-sm font-semibold text-primary">Instalá Gruperly</p>
|
|
<p className="mt-0.5 text-xs leading-relaxed text-foreground/70">
|
|
Abrila directo desde tu pantalla de inicio, sin barra de navegador.
|
|
</p>
|
|
<div className="mt-3 flex items-center gap-2">
|
|
<Button variant="primary" size="sm" onClick={onInstall}>
|
|
<Download className="size-4" strokeWidth={2} />
|
|
Instalar app
|
|
</Button>
|
|
<Button variant="ghost" size="sm" onClick={onDismiss}>
|
|
Ahora no
|
|
</Button>
|
|
</div>
|
|
</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>
|
|
)
|
|
}
|