fix(qr): guest menu 500 (SSR) + remove café discovery from owner panel
1. The /q/{code} guest menu returned HTTP 500 on every load. Root cause:
menu-item-model-viewer.tsx did a top-level `import "@google/model-viewer"`,
a browser-only lib that touches `self` at module evaluation. Next pulled
it into the server module graph (page → qr-guest-menu → qr-menu-3d-sheet →
model-viewer) and SSR crashed with "self is not defined". Now the library
is imported lazily inside useEffect (client-only); a poster placeholder
shows until the custom element registers. Verified /q/* now returns 200.
2. Removed the "discover" (browse other cafés) item from the café owner
sidebar — café discovery belongs in Koja, not the owner panel. The owner
still manages their OWN Koja listing from Settings.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,6 @@ import {
|
||||
Wallet,
|
||||
Clock,
|
||||
LifeBuoy,
|
||||
Compass,
|
||||
} from "lucide-react";
|
||||
|
||||
export type NavGroupId = "main" | "customers" | "management";
|
||||
@@ -39,7 +38,6 @@ export type NavItemKey =
|
||||
| "coupons"
|
||||
| "sms"
|
||||
| "reviews"
|
||||
| "discover"
|
||||
| "inventory"
|
||||
| "expenses"
|
||||
| "shifts"
|
||||
@@ -93,7 +91,8 @@ export const NAV_GROUPS: NavGroupDef[] = [
|
||||
{ key: "coupons", href: "/coupons", icon: Ticket },
|
||||
{ key: "sms", href: "/sms", icon: MessageSquare },
|
||||
{ key: "reviews", href: "/reviews", icon: Star },
|
||||
{ key: "discover", href: "/discover", icon: Compass },
|
||||
// NOTE: café discovery (browsing other cafés) lives in Koja, not the owner
|
||||
// panel. The owner manages their OWN Koja listing from Settings.
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user