PWA Settings
Fixed webmanifest generation and pwa icon. Made nav bar text optional.
This commit is contained in:
23 files changed
+1065
-91
No files matched your search
+41
-12
@@ -7,15 +7,24 @@ import { getBranding } from "@/lib/business/branding";
|
||||
* Phase 8: name/description/colors reflect the installed business (see
|
||||
* src/lib/business/branding.ts) rather than the internal product name.
|
||||
*
|
||||
* `icons` intentionally stays pointed at the app's own pre-generated,
|
||||
* correctly-sized/maskable PWA icon set rather than a business's single
|
||||
* `appIconUrl` — there's no image-processing pipeline in this app to
|
||||
* derive the required 192/512/maskable variants from one arbitrary
|
||||
* uploaded URL (see docs/phase-8-summary.md, "Known limitations"), so
|
||||
* this is fallback rule #2 ("business name + a neutral generated icon"),
|
||||
* applied deliberately rather than risking a broken/non-square install
|
||||
* icon.
|
||||
* `force-dynamic` is required, not optional — without it, Next has no
|
||||
* signal that this route depends on request-time data (a plain DB read
|
||||
* doesn't count as one of Next's dynamic-usage triggers) and statically
|
||||
* renders it once at build time. Since the Docker image is built before
|
||||
* the installation wizard ever runs, that bakes in the pre-install
|
||||
* neutral fallback ("Book an Appointment"/"Booking") permanently — the
|
||||
* real business name/icons would never appear no matter how the Business
|
||||
* row changes afterward.
|
||||
*
|
||||
* Each of the four manifest icons falls back independently to the app's
|
||||
* own pre-generated, correctly-sized/maskable PWA icon when a business
|
||||
* hasn't uploaded its own — a business can set some without all four (see
|
||||
* the "App Icon & Home Screen" super-admin settings screen). This is
|
||||
* fallback rule #2 ("business name + a neutral generated icon") applied
|
||||
* per-field, rather than risking a broken/non-square install icon.
|
||||
*/
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
export default async function manifest(): Promise<MetadataRoute.Manifest> {
|
||||
const branding = await getBranding();
|
||||
return {
|
||||
@@ -29,10 +38,30 @@ export default async function manifest(): Promise<MetadataRoute.Manifest> {
|
||||
theme_color: branding.themeColor,
|
||||
orientation: "portrait-primary",
|
||||
icons: [
|
||||
{ src: "/icons/icon-192.png", sizes: "192x192", type: "image/png", purpose: "any" },
|
||||
{ src: "/icons/icon-512.png", sizes: "512x512", type: "image/png", purpose: "any" },
|
||||
{ src: "/icons/icon-maskable-192.png", sizes: "192x192", type: "image/png", purpose: "maskable" },
|
||||
{ src: "/icons/icon-maskable-512.png", sizes: "512x512", type: "image/png", purpose: "maskable" },
|
||||
{
|
||||
src: branding.icon192Url || "/icons/icon-192.png",
|
||||
sizes: "192x192",
|
||||
type: "image/png",
|
||||
purpose: "any",
|
||||
},
|
||||
{
|
||||
src: branding.icon512Url || "/icons/icon-512.png",
|
||||
sizes: "512x512",
|
||||
type: "image/png",
|
||||
purpose: "any",
|
||||
},
|
||||
{
|
||||
src: branding.maskableIcon192Url || "/icons/icon-maskable-192.png",
|
||||
sizes: "192x192",
|
||||
type: "image/png",
|
||||
purpose: "maskable",
|
||||
},
|
||||
{
|
||||
src: branding.maskableIcon512Url || "/icons/icon-maskable-512.png",
|
||||
sizes: "512x512",
|
||||
type: "image/png",
|
||||
purpose: "maskable",
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user