feat(pwa): implement PWA installation banner and context provider

- Add `generate-icons.ts` script to generate PWA icons from SVG.
- Create `InstallBanner` component for prompting users to install the app.
- Implement `PwaProvider` to manage PWA installation state and events.
- Export `PwaProvider` and `InstallBanner` from the PWA feature index.
This commit is contained in:
Jose Selesan
2026-09-28 20:55:48 -03:00
parent 05da085e36
commit 2fd1826014
23 changed files with 1032 additions and 24 deletions

View File

@@ -2,16 +2,19 @@
<html lang="es">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- viewport-fit=cover habilita env(safe-area-inset-*) en iOS standalone. -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>Gruperly</title>
<meta name="description" content="Gestión de cobros grupales" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap"
rel="stylesheet"
/>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180.png" />
<!-- iOS standalone: sin esto la app abre en un pestaña de Safari. -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<meta name="apple-mobile-web-app-title" content="Gruperly" />
<meta name="theme-color" id="theme-color" content="#ffffff" />
<script>
(function () {
try {
@@ -19,7 +22,11 @@
var isDark =
stored === 'dark' ||
(stored !== 'light' && window.matchMedia('(prefers-color-scheme: dark)').matches);
if (isDark) document.documentElement.classList.add('dark');
if (isDark) {
document.documentElement.classList.add('dark');
var meta = document.getElementById('theme-color');
if (meta) meta.setAttribute('content', '#020617');
}
} catch (e) {}
})();
</script>
@@ -28,4 +35,4 @@
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
</html>