From 82b79554d5c32bc948080a545769bca63d6f86ce Mon Sep 17 00:00:00 2001 From: KimiaMontazeri Date: Wed, 29 Nov 2023 23:49:43 +0330 Subject: [PATCH 1/2] fix(my-account): pass correct value to isWorkshop prop --- frontend/src/pages/my-account/MyAccount.jsx | 27 ++++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/my-account/MyAccount.jsx b/frontend/src/pages/my-account/MyAccount.jsx index 85f882e..225444d 100644 --- a/frontend/src/pages/my-account/MyAccount.jsx +++ b/frontend/src/pages/my-account/MyAccount.jsx @@ -8,7 +8,17 @@ import useMyAccount from './useMyAccount.js'; const TAB_ITEMS = ['Workshops', 'Presentations', 'Cart']; const MyAccount = () => { - const { talks, workshops, handleBuyCart, buyButtonLoading, cart, removeFromCartHandler, toastData, openToast, setOpenToast } = useMyAccount(); + const { + talks, + workshops, + handleBuyCart, + buyButtonLoading, + cart, + removeFromCartHandler, + toastData, + openToast, + setOpenToast, + } = useMyAccount(); const [tabValue, setTabValue] = useState(TAB_ITEMS[0]); const handleChangeTab = (event, newValue) => { @@ -64,14 +74,14 @@ const MyAccount = () => { return items.map((item, index) => ( { Total: {calculateTotalCost()} T - From fa5bda3fd631132de0357b9b0edb99b42df9654e Mon Sep 17 00:00:00 2001 From: KimiaMontazeri Date: Wed, 29 Nov 2023 23:50:50 +0330 Subject: [PATCH 2/2] fix(my-account): disable buy button until payment is fixed --- frontend/src/pages/my-account/MyAccount.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/my-account/MyAccount.jsx b/frontend/src/pages/my-account/MyAccount.jsx index 225444d..cf06941 100644 --- a/frontend/src/pages/my-account/MyAccount.jsx +++ b/frontend/src/pages/my-account/MyAccount.jsx @@ -135,7 +135,8 @@ const MyAccount = () => { onClick={handleBuyCart} variant="contained" sx={{ px: 4 }} - disabled={buyButtonLoading || calculateTotalCost() === 0} + // disabled={buyButtonLoading || calculateTotalCost() === 0} + disabled > {!buyButtonLoading && 'Buy'} {buyButtonLoading && }