Files
gruperly/apps/web/src/features/pwa/IosInstallHint.tsx
Jose Selesan cb872eb8bc feat: soporte multi idioma en la web (infraestructura)
i18next + react-i18next con es-AR (fuente), es-419, pt-BR y en; el idioma
sale del dispositivo (fallback a inglés) y se puede cambiar en Ajustes.
La elección se guarda en localStorage y, para el profe, en users.locale.
Las validaciones de shared pasan a claves y los errores de la API se
traducen por code (con params para límites de plan y cupo).
Migrados: layout, Ajustes, auth, PWA y lib/format.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:14:59 -03:00

42 lines
1.5 KiB
TypeScript

import { Share, X } from 'lucide-react'
import { Trans, useTranslation } from 'react-i18next'
type IosInstallHintProps = {
onDismiss: () => void
}
/**
* Safari on iOS does not expose `beforeinstallprompt`: there is no way to trigger
* the install from the web, the user has to be instructed. It only informs, with
* no action button.
*/
export function IosInstallHint({ onDismiss }: IosInstallHintProps) {
const { t } = useTranslation('pwa')
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">{t('ios.title')}</p>
<p className="mt-0.5 text-xs leading-relaxed text-foreground/70">
<Trans t={t} i18nKey="ios.description" components={{ strong: <span className="font-medium text-foreground" /> }} />
</p>
</div>
<button
type="button"
onClick={onDismiss}
aria-label={t('banner.close')}
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>
)
}