From 38641758c0f2b4de5f0a62486e5b5792fe6e6a76 Mon Sep 17 00:00:00 2001 From: Martin Berka Date: Sat, 17 Jun 2023 10:59:59 +0200 Subject: [PATCH] =?UTF-8?q?Zobrazen=C3=AD=20celkov=C3=A9=20ceny=20za=20Piz?= =?UTF-8?q?za=20day?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- client/src/components/PizzaOrderList.tsx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dc705a7..45b9f8c 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ Aplikace sestává ze tří (čtyř) modulů. - [x] Možnost uložení čísla účtu - [x] Automatické generování a zobrazení QR kódů - [x] https://qr-platba.cz/pro-vyvojare/restful-api/ - - [ ] Zobrazovat celkovou cenu objednávky pod tabulkou objednávek + - [x] Zobrazovat celkovou cenu objednávky pod tabulkou objednávek - [ ] Zobrazit upozornění před smazáním/zamknutím/odemknutím pizza day - [x] Umožnit přidat k objednávce poznámku (např. "bez oliv") - [ ] Negenerovat QR kód pro objednávajícího diff --git a/client/src/components/PizzaOrderList.tsx b/client/src/components/PizzaOrderList.tsx index 73c09c8..a53b124 100644 --- a/client/src/components/PizzaOrderList.tsx +++ b/client/src/components/PizzaOrderList.tsx @@ -12,6 +12,8 @@ export default function PizzaOrderList({ state, orders, onDelete }: { state: Sta return

Zatím žádné objednávky...

} + const total = orders.map(order => order.pizzaList.map(o => o.price).reduce((total, i) => total + i)).reduce((total, i) => total + i); + return @@ -38,6 +40,10 @@ export default function PizzaOrderList({ state, orders, onDelete }: { state: Sta )} + + + +
{order.note || '-'} {order.totalPrice} Kč
Celkem{`${total} Kč`}
} \ No newline at end of file