tia/src/app/~offline/page.tsx
Mannu b6814579c6 feat(pwa): add Serwist service worker, manifest, icons, install prompt
- Wrap next.config.ts with @serwist/next (webpack mode, disabled in dev)
- Service worker: NetworkOnly for /api/*, offline fallback → /~offline
- Web app manifest via Next.js metadata API (app/manifest.ts)
- PNG icon set generated with sharp (192, 512, maskable-512, apple-180)
- iOS meta tags: appleWebApp, themeColor viewport export
- Middleware: pwaAssets early-return so /sw.js never gets a 302→login
- Offline fallback page at /~offline (static, no auth dependency)
- InstallPrompt component: beforeinstallprompt (Android) + iOS Share sheet instructions
- Logout (menu/page.tsx): purge all SW caches on signout (shared-device safety)
- Fix invite/[token]/page.tsx params type for Next.js 16 (use(params))
- Build script: next build --webpack (Serwist requires webpack, not Turbopack)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 23:20:48 +05:30

19 lines
676 B
TypeScript

"use client";
export default function OfflinePage() {
return (
<div className="min-h-screen flex flex-col items-center justify-center bg-gradient-to-br from-rose-50 to-amber-50 p-8 text-center">
<div className="text-6xl mb-6">🌸</div>
<h1 className="text-2xl font-bold text-rose-500 mb-3">You&apos;re offline</h1>
<p className="text-gray-600 mb-6 max-w-xs">
Reconnect to the internet to keep tracking with Tia.
</p>
<button
onClick={() => window.location.reload()}
className="px-6 py-3 bg-rose-400 text-white rounded-xl font-semibold active:opacity-80"
>
Try again
</button>
</div>
);
}