From 3c22ba0d485c5749f82c66040471a7768c3b8402 Mon Sep 17 00:00:00 2001
From: Chris Maki <100000473+SirChristianWilliam@users.noreply.github.com>
Date: Thu, 6 Apr 2023 20:59:52 -0500
Subject: [PATCH] Update Cart.js checkout button
Previously, the checkout button was always enabled, even if there were no items in the cart. The added code conditionally renders the button as either disabled or enabled, so when there are no items in the cart it will not be able to be clicked.
---
react-js-buy/src/components/Cart.js | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/react-js-buy/src/components/Cart.js b/react-js-buy/src/components/Cart.js
index c1da1c7..922cb87 100644
--- a/react-js-buy/src/components/Cart.js
+++ b/react-js-buy/src/components/Cart.js
@@ -56,7 +56,22 @@ class Cart extends Component {
$ {this.props.checkout.totalPrice}
-
+ {line_items.length >= 1 ? (
+
+ ) : (
+
+ )}
)