Add menu item customization/detail pages and configurable currency formatting
Lets customers pick options on a menu item detail page before adding to the basket, and makes displayed prices respect a configurable currency/locale via VITE_CURRENCY/VITE_LOCALE. Also crossfades the basket's empty/filled states with AnimatePresence in wait mode instead of animating both at once. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -100,6 +100,15 @@ export const seedGhostKitchen = async (db: NodePgDatabase<typeof schema>) => {
|
||||
},
|
||||
])
|
||||
|
||||
const pizzaOptions = await db
|
||||
.insert(schema.menuItemOptions)
|
||||
.values([
|
||||
{ menuItemId: pizza.id, name: 'Extra cheese', priceDeltaCents: 150 },
|
||||
{ menuItemId: pizza.id, name: 'No onions', priceDeltaCents: 0 },
|
||||
{ menuItemId: pizza.id, name: 'Extra sauce', priceDeltaCents: 0 },
|
||||
])
|
||||
.returning()
|
||||
|
||||
const [burger] = await db
|
||||
.insert(schema.menuItems)
|
||||
.values({
|
||||
@@ -127,6 +136,15 @@ export const seedGhostKitchen = async (db: NodePgDatabase<typeof schema>) => {
|
||||
},
|
||||
])
|
||||
|
||||
const burgerOptions = await db
|
||||
.insert(schema.menuItemOptions)
|
||||
.values([
|
||||
{ menuItemId: burger.id, name: 'Extra cheese', priceDeltaCents: 100 },
|
||||
{ menuItemId: burger.id, name: 'No pickles', priceDeltaCents: 0 },
|
||||
{ menuItemId: burger.id, name: 'Extra patty', priceDeltaCents: 250 },
|
||||
])
|
||||
.returning()
|
||||
|
||||
return {
|
||||
brand,
|
||||
machineTags: {
|
||||
@@ -137,6 +155,7 @@ export const seedGhostKitchen = async (db: NodePgDatabase<typeof schema>) => {
|
||||
},
|
||||
machines: { prep1, oven1, grill1, assembly1 },
|
||||
menuItems: { pizza, burger },
|
||||
menuItemOptions: { pizza: pizzaOptions, burger: burgerOptions },
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user