From 9a65214c012e69d5abbdb4ae810ff378421d6189 Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Mon, 14 Oct 2024 07:40:41 +0200 Subject: [PATCH] cart --- frontend/src/scripts/index.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index 24d8e38..b0426d8 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -250,6 +250,11 @@ class Main extends Component { Eshop } + {this.state.cart.length > 0 && + + } @@ -261,6 +266,27 @@ class Main extends Component {
{this.setState({status: "", status_text:""})}}> {this.state.status_text}
} + {this.state.page == "#cart" && +
+ + + + + + + + + + + {this.state.cart.map(product => + + + + + )} + +
NázevMnožstvíCena
{product.name}{product.quantity}{product.price} Kč
+
} {this.state.page == "#eshop" &&
{this.state.products.map(product => @@ -300,7 +326,6 @@ class Main extends Component { {racer.paid?"Zaplatil":"Nezaplatil"} )} -