@merchi/cart 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +134 -0
- package/esm/Cart.js +62 -0
- package/esm/CartAlert.js +47 -0
- package/esm/CartHeader.js +29 -0
- package/esm/CartProvider.js +1101 -0
- package/esm/CartTotals.js +89 -0
- package/esm/assets/merchi-monster-loader.gif +0 -0
- package/esm/assets/merchi-swipe-outline.png +0 -0
- package/esm/assets/product-not-found.png +0 -0
- package/esm/assets/stripe-payment-secure.png +0 -0
- package/esm/buttons/Button.js +23 -0
- package/esm/buttons/ButtonBack.js +35 -0
- package/esm/buttons/ButtonClearCart.js +17 -0
- package/esm/buttons/ButtonInvoiceDownload.js +88 -0
- package/esm/buttons/ButtonNext.js +39 -0
- package/esm/buttons/ButtonNextDynamic.js +19 -0
- package/esm/buttons/ButtonOpenCartMerchiCartModal.js +47 -0
- package/esm/buttons/ButtonPay.js +26 -0
- package/esm/buttons/ButtonShipmentTabNext.js +28 -0
- package/esm/buttons/index.js +7 -0
- package/esm/components/Alert.js +26 -0
- package/esm/components/CartBody.js +14 -0
- package/esm/components/CartClient.js +62 -0
- package/esm/components/CartFooter.js +12 -0
- package/esm/components/CartItemRow.js +230 -0
- package/esm/components/CartPaymentSettingsInvalid.js +13 -0
- package/esm/components/CartShipment.js +52 -0
- package/esm/components/CartTabContent.js +12 -0
- package/esm/components/CartTabPanel.js +25 -0
- package/esm/components/CartTableContainer.js +12 -0
- package/esm/components/CartTitle.js +26 -0
- package/esm/components/CartTotalsListGroup.js +71 -0
- package/esm/components/Collapse.js +32 -0
- package/esm/components/CustomCartProductForm.js +128 -0
- package/esm/components/CustomerCheckoutMethodTabs.js +94 -0
- package/esm/components/DiscountInputGroup.js +293 -0
- package/esm/components/LoadingTemplate.js +23 -0
- package/esm/components/NoCartItems.js +20 -0
- package/esm/components/ShipmentGroupCard.js +207 -0
- package/esm/components/Table.js +13 -0
- package/esm/components/containers.js +31 -0
- package/esm/components/index.js +18 -0
- package/esm/components/product-form-sdk-externals.js +36 -0
- package/esm/forms/FormNewCustomer.js +243 -0
- package/esm/forms/FormReturningCustomer.js +165 -0
- package/esm/forms/FormShipmentAddressAndNotes.js +195 -0
- package/esm/forms/FormSquarePayment.js +19 -0
- package/esm/forms/FormStripePayment.js +19 -0
- package/esm/forms/FormWhatsappCustomer.js +253 -0
- package/esm/forms/InputAcceptUserTermsAndConditions.js +35 -0
- package/esm/forms/InputError.js +16 -0
- package/esm/forms/InputSelect.js +48 -0
- package/esm/forms/InputText.js +56 -0
- package/esm/forms/InputsAddress.js +476 -0
- package/esm/forms/index.js +8 -0
- package/esm/index.js +13 -0
- package/esm/modals.js +51 -0
- package/esm/panels/PanelCartItems.js +49 -0
- package/esm/panels/PanelCartShipment.js +66 -0
- package/esm/panels/PanelClearCart.js +56 -0
- package/esm/panels/PanelClientCheckout.js +81 -0
- package/esm/panels/PanelEditCartItem.js +199 -0
- package/esm/panels/PanelPaymentSuccess.js +63 -0
- package/esm/panels/index.js +7 -0
- package/esm/square/SquareCard.js +106 -0
- package/esm/stripe/LegacyStripeCardForm.js +157 -0
- package/esm/stripe/StripeCardFields.js +126 -0
- package/esm/stripe/StripeCardForm.js +33 -0
- package/esm/stripe/StripePaymentButtons.js +98 -0
- package/esm/stripe/actions.js +192 -0
- package/esm/stripe/utils.js +20 -0
- package/esm/styles/globals.css +463 -0
- package/esm/styles/globals.css.map +1 -0
- package/esm/tabs/CartNav.js +28 -0
- package/esm/tabs/NavTab.js +31 -0
- package/esm/types/assets.d.js +0 -0
- package/esm/types/index.js +1 -0
- package/esm/types/merchi_product_form/index.d.js +0 -0
- package/esm/types/merchi_sdk_ts/index.d.js +0 -0
- package/esm/types/react-redux/index.d.js +0 -0
- package/esm/utilities/address.js +457 -0
- package/esm/utilities/area.js +297 -0
- package/esm/utilities/cart.js +95 -0
- package/esm/utilities/company.js +6 -0
- package/esm/utilities/cookie.js +156 -0
- package/esm/utilities/currency.js +219 -0
- package/esm/utilities/customForm.js +57 -0
- package/esm/utilities/helpers.js +229 -0
- package/esm/utilities/index.js +14 -0
- package/esm/utilities/invoice.js +112 -0
- package/esm/utilities/job.js +9 -0
- package/esm/utilities/local_storage.js +85 -0
- package/esm/utilities/product.js +13 -0
- package/esm/utilities/shipment.js +11 -0
- package/esm/utilities/tabs.js +51 -0
- package/esm/utilities/user.js +65 -0
- package/esm/utilities/variations.js +58 -0
- package/lib/Cart.d.ts +9 -0
- package/lib/Cart.js +69 -0
- package/lib/CartAlert.d.ts +3 -0
- package/lib/CartAlert.js +53 -0
- package/lib/CartHeader.d.ts +3 -0
- package/lib/CartHeader.js +37 -0
- package/lib/CartProvider.d.ts +236 -0
- package/lib/CartProvider.js +1107 -0
- package/lib/CartTotals.d.ts +7 -0
- package/lib/CartTotals.js +96 -0
- package/lib/assets/merchi-monster-loader.gif +0 -0
- package/lib/assets/merchi-swipe-outline.png +0 -0
- package/lib/assets/product-not-found.png +0 -0
- package/lib/assets/stripe-payment-secure.png +0 -0
- package/lib/buttons/Button.d.ts +11 -0
- package/lib/buttons/Button.js +31 -0
- package/lib/buttons/ButtonBack.d.ts +6 -0
- package/lib/buttons/ButtonBack.js +44 -0
- package/lib/buttons/ButtonClearCart.d.ts +3 -0
- package/lib/buttons/ButtonClearCart.js +24 -0
- package/lib/buttons/ButtonInvoiceDownload.d.ts +3 -0
- package/lib/buttons/ButtonInvoiceDownload.js +96 -0
- package/lib/buttons/ButtonNext.d.ts +3 -0
- package/lib/buttons/ButtonNext.js +48 -0
- package/lib/buttons/ButtonNextDynamic.d.ts +3 -0
- package/lib/buttons/ButtonNextDynamic.js +28 -0
- package/lib/buttons/ButtonOpenCartMerchiCartModal.d.ts +9 -0
- package/lib/buttons/ButtonOpenCartMerchiCartModal.js +57 -0
- package/lib/buttons/ButtonPay.d.ts +7 -0
- package/lib/buttons/ButtonPay.js +35 -0
- package/lib/buttons/ButtonShipmentTabNext.d.ts +2 -0
- package/lib/buttons/ButtonShipmentTabNext.js +37 -0
- package/lib/buttons/index.d.ts +7 -0
- package/lib/buttons/index.js +48 -0
- package/lib/components/Alert.d.ts +7 -0
- package/lib/components/Alert.js +34 -0
- package/lib/components/CartBody.d.ts +7 -0
- package/lib/components/CartBody.js +22 -0
- package/lib/components/CartClient.d.ts +4 -0
- package/lib/components/CartClient.js +71 -0
- package/lib/components/CartFooter.d.ts +6 -0
- package/lib/components/CartFooter.js +20 -0
- package/lib/components/CartItemRow.d.ts +7 -0
- package/lib/components/CartItemRow.js +236 -0
- package/lib/components/CartPaymentSettingsInvalid.d.ts +2 -0
- package/lib/components/CartPaymentSettingsInvalid.js +21 -0
- package/lib/components/CartShipment.d.ts +6 -0
- package/lib/components/CartShipment.js +59 -0
- package/lib/components/CartTabContent.d.ts +6 -0
- package/lib/components/CartTabContent.js +20 -0
- package/lib/components/CartTabPanel.d.ts +7 -0
- package/lib/components/CartTabPanel.js +31 -0
- package/lib/components/CartTableContainer.d.ts +6 -0
- package/lib/components/CartTableContainer.js +20 -0
- package/lib/components/CartTitle.d.ts +2 -0
- package/lib/components/CartTitle.js +34 -0
- package/lib/components/CartTotalsListGroup.d.ts +3 -0
- package/lib/components/CartTotalsListGroup.js +78 -0
- package/lib/components/Collapse.d.ts +3 -0
- package/lib/components/Collapse.js +40 -0
- package/lib/components/CustomCartProductForm.d.ts +18 -0
- package/lib/components/CustomCartProductForm.js +136 -0
- package/lib/components/CustomerCheckoutMethodTabs.d.ts +6 -0
- package/lib/components/CustomerCheckoutMethodTabs.js +103 -0
- package/lib/components/DiscountInputGroup.d.ts +2 -0
- package/lib/components/DiscountInputGroup.js +301 -0
- package/lib/components/LoadingTemplate.d.ts +7 -0
- package/lib/components/LoadingTemplate.js +30 -0
- package/lib/components/NoCartItems.d.ts +3 -0
- package/lib/components/NoCartItems.js +27 -0
- package/lib/components/ShipmentGroupCard.d.ts +7 -0
- package/lib/components/ShipmentGroupCard.js +215 -0
- package/lib/components/Table.d.ts +7 -0
- package/lib/components/Table.js +19 -0
- package/lib/components/containers.d.ts +14 -0
- package/lib/components/containers.js +40 -0
- package/lib/components/index.d.ts +18 -0
- package/lib/components/index.js +133 -0
- package/lib/components/product-form-sdk-externals.d.ts +46 -0
- package/lib/components/product-form-sdk-externals.js +43 -0
- package/lib/forms/FormNewCustomer.d.ts +4 -0
- package/lib/forms/FormNewCustomer.js +252 -0
- package/lib/forms/FormReturningCustomer.d.ts +3 -0
- package/lib/forms/FormReturningCustomer.js +173 -0
- package/lib/forms/FormShipmentAddressAndNotes.d.ts +15 -0
- package/lib/forms/FormShipmentAddressAndNotes.js +203 -0
- package/lib/forms/FormSquarePayment.d.ts +3 -0
- package/lib/forms/FormSquarePayment.js +27 -0
- package/lib/forms/FormStripePayment.d.ts +3 -0
- package/lib/forms/FormStripePayment.js +27 -0
- package/lib/forms/FormWhatsappCustomer.d.ts +3 -0
- package/lib/forms/FormWhatsappCustomer.js +261 -0
- package/lib/forms/InputAcceptUserTermsAndConditions.d.ts +7 -0
- package/lib/forms/InputAcceptUserTermsAndConditions.js +41 -0
- package/lib/forms/InputError.d.ts +8 -0
- package/lib/forms/InputError.js +24 -0
- package/lib/forms/InputSelect.d.ts +14 -0
- package/lib/forms/InputSelect.js +55 -0
- package/lib/forms/InputText.d.ts +12 -0
- package/lib/forms/InputText.js +63 -0
- package/lib/forms/InputsAddress.d.ts +11 -0
- package/lib/forms/InputsAddress.js +485 -0
- package/lib/forms/index.d.ts +8 -0
- package/lib/forms/index.js +63 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +93 -0
- package/lib/modals.d.ts +17 -0
- package/lib/modals.js +59 -0
- package/lib/panels/PanelCartItems.d.ts +3 -0
- package/lib/panels/PanelCartItems.js +56 -0
- package/lib/panels/PanelCartShipment.d.ts +3 -0
- package/lib/panels/PanelCartShipment.js +72 -0
- package/lib/panels/PanelClearCart.d.ts +3 -0
- package/lib/panels/PanelClearCart.js +62 -0
- package/lib/panels/PanelClientCheckout.d.ts +3 -0
- package/lib/panels/PanelClientCheckout.js +88 -0
- package/lib/panels/PanelEditCartItem.d.ts +6 -0
- package/lib/panels/PanelEditCartItem.js +206 -0
- package/lib/panels/PanelPaymentSuccess.d.ts +3 -0
- package/lib/panels/PanelPaymentSuccess.js +69 -0
- package/lib/panels/index.d.ts +7 -0
- package/lib/panels/index.js +48 -0
- package/lib/square/SquareCard.d.ts +3 -0
- package/lib/square/SquareCard.js +114 -0
- package/lib/stripe/LegacyStripeCardForm.d.ts +3 -0
- package/lib/stripe/LegacyStripeCardForm.js +166 -0
- package/lib/stripe/StripeCardFields.d.ts +15 -0
- package/lib/stripe/StripeCardFields.js +135 -0
- package/lib/stripe/StripeCardForm.d.ts +2 -0
- package/lib/stripe/StripeCardForm.js +42 -0
- package/lib/stripe/StripePaymentButtons.d.ts +8 -0
- package/lib/stripe/StripePaymentButtons.js +106 -0
- package/lib/stripe/actions.d.ts +4 -0
- package/lib/stripe/actions.js +200 -0
- package/lib/stripe/utils.d.ts +18 -0
- package/lib/stripe/utils.js +27 -0
- package/lib/styles/globals.css +463 -0
- package/lib/styles/globals.css.map +1 -0
- package/lib/tabs/CartNav.d.ts +3 -0
- package/lib/tabs/CartNav.js +36 -0
- package/lib/tabs/NavTab.d.ts +9 -0
- package/lib/tabs/NavTab.js +39 -0
- package/lib/types/index.d.ts +13 -0
- package/lib/types/index.js +1 -0
- package/lib/utilities/address.d.ts +30 -0
- package/lib/utilities/address.js +468 -0
- package/lib/utilities/area.d.ts +77 -0
- package/lib/utilities/area.js +328 -0
- package/lib/utilities/cart.d.ts +9 -0
- package/lib/utilities/cart.js +108 -0
- package/lib/utilities/company.d.ts +2 -0
- package/lib/utilities/company.js +13 -0
- package/lib/utilities/cookie.d.ts +4 -0
- package/lib/utilities/cookie.js +165 -0
- package/lib/utilities/currency.d.ts +5 -0
- package/lib/utilities/currency.js +229 -0
- package/lib/utilities/customForm.d.ts +17 -0
- package/lib/utilities/customForm.js +64 -0
- package/lib/utilities/helpers.d.ts +24 -0
- package/lib/utilities/helpers.js +240 -0
- package/lib/utilities/index.d.ts +14 -0
- package/lib/utilities/index.js +159 -0
- package/lib/utilities/invoice.d.ts +3 -0
- package/lib/utilities/invoice.js +118 -0
- package/lib/utilities/job.d.ts +1 -0
- package/lib/utilities/job.js +15 -0
- package/lib/utilities/local_storage.d.ts +31 -0
- package/lib/utilities/local_storage.js +96 -0
- package/lib/utilities/product.d.ts +2 -0
- package/lib/utilities/product.js +21 -0
- package/lib/utilities/shipment.d.ts +2 -0
- package/lib/utilities/shipment.js +18 -0
- package/lib/utilities/tabs.d.ts +14 -0
- package/lib/utilities/tabs.js +60 -0
- package/lib/utilities/user.d.ts +5 -0
- package/lib/utilities/user.js +75 -0
- package/lib/utilities/variations.d.ts +18 -0
- package/lib/utilities/variations.js +66 -0
- package/package.json +109 -0
- package/src/Cart.tsx +96 -0
- package/src/CartAlert.tsx +35 -0
- package/src/CartHeader.tsx +28 -0
- package/src/CartProvider.tsx +992 -0
- package/src/CartTotals.tsx +102 -0
- package/src/assets/merchi-monster-loader.gif +0 -0
- package/src/assets/merchi-swipe-outline.png +0 -0
- package/src/assets/product-not-found.png +0 -0
- package/src/assets/stripe-payment-secure.png +0 -0
- package/src/buttons/Button.tsx +35 -0
- package/src/buttons/ButtonBack.tsx +42 -0
- package/src/buttons/ButtonClearCart.tsx +17 -0
- package/src/buttons/ButtonInvoiceDownload.tsx +60 -0
- package/src/buttons/ButtonNext.tsx +35 -0
- package/src/buttons/ButtonNextDynamic.tsx +31 -0
- package/src/buttons/ButtonOpenCartMerchiCartModal.tsx +61 -0
- package/src/buttons/ButtonPay.tsx +32 -0
- package/src/buttons/ButtonShipmentTabNext.tsx +24 -0
- package/src/buttons/index.ts +15 -0
- package/src/components/Alert.tsx +31 -0
- package/src/components/CartBody.tsx +16 -0
- package/src/components/CartClient.tsx +52 -0
- package/src/components/CartFooter.tsx +15 -0
- package/src/components/CartItemRow.tsx +212 -0
- package/src/components/CartPaymentSettingsInvalid.tsx +12 -0
- package/src/components/CartShipment.tsx +56 -0
- package/src/components/CartTabContent.tsx +15 -0
- package/src/components/CartTabPanel.tsx +25 -0
- package/src/components/CartTableContainer.tsx +15 -0
- package/src/components/CartTitle.tsx +22 -0
- package/src/components/CartTotalsListGroup.tsx +58 -0
- package/src/components/Collapse.tsx +23 -0
- package/src/components/CustomCartProductForm.tsx +123 -0
- package/src/components/CustomerCheckoutMethodTabs.tsx +106 -0
- package/src/components/DiscountInputGroup.tsx +160 -0
- package/src/components/LoadingTemplate.tsx +22 -0
- package/src/components/NoCartItems.tsx +20 -0
- package/src/components/ShipmentGroupCard.tsx +170 -0
- package/src/components/Table.tsx +15 -0
- package/src/components/containers.tsx +40 -0
- package/src/components/index.ts +38 -0
- package/src/components/product-form-sdk-externals.ts +67 -0
- package/src/forms/FormNewCustomer.tsx +170 -0
- package/src/forms/FormReturningCustomer.tsx +117 -0
- package/src/forms/FormShipmentAddressAndNotes.tsx +165 -0
- package/src/forms/FormSquarePayment.tsx +19 -0
- package/src/forms/FormStripePayment.tsx +19 -0
- package/src/forms/FormWhatsappCustomer.tsx +179 -0
- package/src/forms/InputAcceptUserTermsAndConditions.tsx +43 -0
- package/src/forms/InputError.tsx +23 -0
- package/src/forms/InputSelect.tsx +58 -0
- package/src/forms/InputText.tsx +56 -0
- package/src/forms/InputsAddress.tsx +438 -0
- package/src/forms/index.ts +18 -0
- package/src/index.ts +31 -0
- package/src/modals.tsx +65 -0
- package/src/panels/PanelCartItems.tsx +56 -0
- package/src/panels/PanelCartShipment.tsx +86 -0
- package/src/panels/PanelClearCart.tsx +50 -0
- package/src/panels/PanelClientCheckout.tsx +102 -0
- package/src/panels/PanelEditCartItem.tsx +172 -0
- package/src/panels/PanelPaymentSuccess.tsx +66 -0
- package/src/panels/index.ts +15 -0
- package/src/square/SquareCard.tsx +84 -0
- package/src/stripe/LegacyStripeCardForm.tsx +91 -0
- package/src/stripe/StripeCardFields.tsx +173 -0
- package/src/stripe/StripeCardForm.tsx +18 -0
- package/src/stripe/StripePaymentButtons.tsx +117 -0
- package/src/stripe/actions.ts +94 -0
- package/src/stripe/utils.ts +22 -0
- package/src/styles/globals.scss +475 -0
- package/src/tabs/CartNav.tsx +18 -0
- package/src/tabs/NavTab.tsx +36 -0
- package/src/types/assets.d.ts +4 -0
- package/src/types/index.ts +15 -0
- package/src/types/merchi_product_form/index.d.ts +1 -0
- package/src/types/merchi_sdk_ts/index.d.ts +1 -0
- package/src/types/react-redux/index.d.ts +0 -0
- package/src/utilities/address.ts +463 -0
- package/src/utilities/area.ts +359 -0
- package/src/utilities/cart.ts +80 -0
- package/src/utilities/company.ts +8 -0
- package/src/utilities/cookie.ts +58 -0
- package/src/utilities/currency.ts +216 -0
- package/src/utilities/customForm.ts +71 -0
- package/src/utilities/helpers.ts +213 -0
- package/src/utilities/index.ts +14 -0
- package/src/utilities/invoice.ts +60 -0
- package/src/utilities/job.ts +13 -0
- package/src/utilities/local_storage.ts +130 -0
- package/src/utilities/product.ts +14 -0
- package/src/utilities/shipment.ts +11 -0
- package/src/utilities/tabs.ts +38 -0
- package/src/utilities/user.ts +33 -0
- package/src/utilities/variations.ts +80 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { formatCurrency } from './utilities/currency';
|
|
2
|
+
import { cartRequiresShipment } from './utilities/cart';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { faCircleNotch } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import { Table } from './components';
|
|
6
|
+
import { useCartContext } from './CartProvider';
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
attribute: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function CartTotal({ attribute }: Props) {
|
|
13
|
+
const {
|
|
14
|
+
loading,
|
|
15
|
+
loadingTotals
|
|
16
|
+
} = useCartContext();
|
|
17
|
+
const {
|
|
18
|
+
cart,
|
|
19
|
+
fetchingCart,
|
|
20
|
+
} = useCartContext();
|
|
21
|
+
const { domain } = cart;
|
|
22
|
+
const company = domain ? domain.company : null;
|
|
23
|
+
const currency = company ? company.defaultCurrency : 'AUD';
|
|
24
|
+
const isLoading =
|
|
25
|
+
fetchingCart ||
|
|
26
|
+
loadingTotals ||
|
|
27
|
+
loading;
|
|
28
|
+
const money = cart[attribute] ? cart[attribute] : 0;
|
|
29
|
+
return (
|
|
30
|
+
<div style={{paddingRight: 8}}>
|
|
31
|
+
{isLoading ?
|
|
32
|
+
<FontAwesomeIcon
|
|
33
|
+
icon={faCircleNotch}
|
|
34
|
+
spin={true}
|
|
35
|
+
/>
|
|
36
|
+
:
|
|
37
|
+
`${currency} ${formatCurrency(money, { currency })}`
|
|
38
|
+
}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
interface RowProps {
|
|
44
|
+
attr: string;
|
|
45
|
+
name: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function CostsTableRow({ attr, name }: RowProps) {
|
|
49
|
+
const {
|
|
50
|
+
classNameCartTotalItem,
|
|
51
|
+
classNameCartTotalItemPrice,
|
|
52
|
+
} = useCartContext();
|
|
53
|
+
return (
|
|
54
|
+
<tr>
|
|
55
|
+
<td className={classNameCartTotalItem}>
|
|
56
|
+
{name}
|
|
57
|
+
</td>
|
|
58
|
+
<th className={classNameCartTotalItemPrice}>
|
|
59
|
+
<CartTotal attribute={attr} />
|
|
60
|
+
</th>
|
|
61
|
+
</tr>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function CartTotals() {
|
|
66
|
+
const {
|
|
67
|
+
cart,
|
|
68
|
+
classNameCartTotalContainer,
|
|
69
|
+
classNameCartTotalItemPrice
|
|
70
|
+
} = useCartContext();
|
|
71
|
+
const cartItems = cart?.cartItems || [];
|
|
72
|
+
return (
|
|
73
|
+
<div className={classNameCartTotalContainer}>
|
|
74
|
+
<Table className='merchi-cart-total-table'>
|
|
75
|
+
<tbody>
|
|
76
|
+
<CostsTableRow
|
|
77
|
+
attr='cartItemsTotalCost'
|
|
78
|
+
name='Subtotal'
|
|
79
|
+
/>
|
|
80
|
+
{cartRequiresShipment({ ...cart, cartItems }) && (
|
|
81
|
+
<CostsTableRow
|
|
82
|
+
attr='shipmentTotalCost'
|
|
83
|
+
name='Shipping'
|
|
84
|
+
/>
|
|
85
|
+
)}
|
|
86
|
+
<CostsTableRow
|
|
87
|
+
attr='totalCost'
|
|
88
|
+
name='Total'
|
|
89
|
+
/>
|
|
90
|
+
<tr>
|
|
91
|
+
<td />
|
|
92
|
+
<td className={classNameCartTotalItemPrice}>
|
|
93
|
+
Total price includes taxes
|
|
94
|
+
</td>
|
|
95
|
+
</tr>
|
|
96
|
+
</tbody>
|
|
97
|
+
</Table>
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export default CartTotals;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCartContext } from "../CartProvider";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children: any;
|
|
6
|
+
className?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
form?: string;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
type?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type ButtonType = "button" | "reset" | "submit" | undefined;
|
|
14
|
+
|
|
15
|
+
export default function Button({
|
|
16
|
+
children,
|
|
17
|
+
className = '',
|
|
18
|
+
disabled,
|
|
19
|
+
form,
|
|
20
|
+
onClick,
|
|
21
|
+
type = 'button',
|
|
22
|
+
}: Props) {
|
|
23
|
+
const { classNameBtn } = useCartContext();
|
|
24
|
+
return (
|
|
25
|
+
<button
|
|
26
|
+
className={`${classNameBtn} ${className}`}
|
|
27
|
+
disabled={disabled}
|
|
28
|
+
form={form}
|
|
29
|
+
onClick={onClick}
|
|
30
|
+
type={(type as ButtonType)}
|
|
31
|
+
>
|
|
32
|
+
{children}
|
|
33
|
+
</button>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCartContext } from '../CartProvider';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { faArrowLeft } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import Button from './Button';
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
text?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function ButtonBack({ text }: Props) {
|
|
12
|
+
const {
|
|
13
|
+
activeTabIndex,
|
|
14
|
+
classNameBtnBack,
|
|
15
|
+
onClickClose,
|
|
16
|
+
setActiveTabIndex,
|
|
17
|
+
tabs,
|
|
18
|
+
toggleCartModal,
|
|
19
|
+
} = useCartContext();
|
|
20
|
+
const currentTabIndex = tabs.findIndex((t: any) => t.tabId === activeTabIndex);
|
|
21
|
+
let nextTab = null;
|
|
22
|
+
if (currentTabIndex > 0) {
|
|
23
|
+
nextTab = tabs[currentTabIndex - 1];
|
|
24
|
+
}
|
|
25
|
+
const nextTabId = nextTab ? nextTab.tabId : 0;
|
|
26
|
+
const close = onClickClose || toggleCartModal;
|
|
27
|
+
return (
|
|
28
|
+
<Button
|
|
29
|
+
className={classNameBtnBack}
|
|
30
|
+
onClick={activeTabIndex === 0 ?
|
|
31
|
+
close
|
|
32
|
+
:
|
|
33
|
+
() => setActiveTabIndex(nextTabId)
|
|
34
|
+
}
|
|
35
|
+
>
|
|
36
|
+
<FontAwesomeIcon icon={faArrowLeft} />
|
|
37
|
+
{text ? ` ${text}` : ''}
|
|
38
|
+
</Button>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default ButtonBack;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useCartContext } from '../CartProvider';
|
|
2
|
+
import { tabIdClearCart } from '../utilities/tabs';
|
|
3
|
+
import Button from './Button';
|
|
4
|
+
|
|
5
|
+
function ButtonClearCart() {
|
|
6
|
+
const { classNameBtnCartClear, setActiveTabIndex } = useCartContext();
|
|
7
|
+
return (
|
|
8
|
+
<Button
|
|
9
|
+
className={classNameBtnCartClear}
|
|
10
|
+
onClick={() => setActiveTabIndex(tabIdClearCart)}
|
|
11
|
+
>
|
|
12
|
+
Clear cart
|
|
13
|
+
</Button>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default ButtonClearCart;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCartContext } from '../CartProvider';
|
|
3
|
+
import { generatePublicInvoicePdf } from '../utilities/invoice';
|
|
4
|
+
import { useState } from 'react';
|
|
5
|
+
import { CgSpinner } from 'react-icons/cg';
|
|
6
|
+
import { FaFileInvoiceDollar } from 'react-icons/fa';
|
|
7
|
+
|
|
8
|
+
function ButtonInvoiceDownload() {
|
|
9
|
+
const {
|
|
10
|
+
alertError,
|
|
11
|
+
classNameBtnDownloadInvoice,
|
|
12
|
+
apiUrl,
|
|
13
|
+
invoiceJson
|
|
14
|
+
} = useCartContext();
|
|
15
|
+
const { unpaid } = invoiceJson;
|
|
16
|
+
const [loading, setLoading] = useState(false);
|
|
17
|
+
async function generate(receipt?: boolean) {
|
|
18
|
+
setLoading(true);
|
|
19
|
+
try {
|
|
20
|
+
await generatePublicInvoicePdf((apiUrl as string), invoiceJson, receipt);
|
|
21
|
+
setLoading(false);
|
|
22
|
+
} catch (e: any) {
|
|
23
|
+
alertError(e.message);
|
|
24
|
+
setLoading(false);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
{unpaid ? (
|
|
30
|
+
<button
|
|
31
|
+
className={classNameBtnDownloadInvoice}
|
|
32
|
+
disabled={loading}
|
|
33
|
+
onClick={() => generate(false)}
|
|
34
|
+
>
|
|
35
|
+
{loading ? (
|
|
36
|
+
<CgSpinner fontSize='1.1rem' className='animate_spin mr-2' />
|
|
37
|
+
) : (
|
|
38
|
+
<FaFileInvoiceDollar fontSize='1.1rem' className='mr-2' />
|
|
39
|
+
)}
|
|
40
|
+
Download Invoice
|
|
41
|
+
</button>
|
|
42
|
+
) : (
|
|
43
|
+
<button
|
|
44
|
+
className={classNameBtnDownloadInvoice}
|
|
45
|
+
disabled={loading}
|
|
46
|
+
onClick={() => generate(true)}
|
|
47
|
+
>
|
|
48
|
+
{loading ? (
|
|
49
|
+
<CgSpinner fontSize='1.1rem' className='animate_spin mr-2' />
|
|
50
|
+
) : (
|
|
51
|
+
<FaFileInvoiceDollar fontSize='1.1rem' className='mr-2' />
|
|
52
|
+
)}
|
|
53
|
+
Download Receipt
|
|
54
|
+
</button>
|
|
55
|
+
)}
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default ButtonInvoiceDownload;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { tabIdCheckout } from '../utilities/tabs';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { faArrowRight, faCircleNotch, faCreditCard } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import Button from './Button';
|
|
6
|
+
import { useCartContext } from '../CartProvider';
|
|
7
|
+
|
|
8
|
+
function ButtonNext() {
|
|
9
|
+
const {
|
|
10
|
+
activeTabIndex,
|
|
11
|
+
classNameBtnNext,
|
|
12
|
+
classNameBtnNextComplete,
|
|
13
|
+
loading,
|
|
14
|
+
setActiveTabIndex,
|
|
15
|
+
tabs,
|
|
16
|
+
} = useCartContext();
|
|
17
|
+
const currentTabIndex = tabs.findIndex((t: any) => t.tabId === activeTabIndex);
|
|
18
|
+
const nextTab = tabs[currentTabIndex + 1];
|
|
19
|
+
const isCheckoutTabOpen = activeTabIndex === tabIdCheckout;
|
|
20
|
+
const icon = loading ? faCircleNotch : isCheckoutTabOpen ? faCreditCard : faArrowRight;
|
|
21
|
+
return (
|
|
22
|
+
<Button
|
|
23
|
+
className={isCheckoutTabOpen ? classNameBtnNextComplete : classNameBtnNext}
|
|
24
|
+
onClick={nextTab ? () => setActiveTabIndex(nextTab.tabId) : undefined}
|
|
25
|
+
disabled={loading}
|
|
26
|
+
>
|
|
27
|
+
<FontAwesomeIcon icon={icon} spin={loading} />
|
|
28
|
+
<span style={{marginLeft: '5px'}}>
|
|
29
|
+
{loading ? 'Loading...' : 'Next'}
|
|
30
|
+
</span>
|
|
31
|
+
</Button>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default ButtonNext;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCartContext } from '../CartProvider';
|
|
3
|
+
import {
|
|
4
|
+
tabIdCheckout,
|
|
5
|
+
tabIdItems,
|
|
6
|
+
tabIdPaymentSuccess,
|
|
7
|
+
tabIdShipment,
|
|
8
|
+
} from '../utilities/tabs';
|
|
9
|
+
import ButtonNext from './ButtonNext';
|
|
10
|
+
import ButtonShipmentTabNext from './ButtonShipmentTabNext';
|
|
11
|
+
|
|
12
|
+
function ButtonNextDynamic() {
|
|
13
|
+
const { cart, activeTabIndex } = useCartContext();
|
|
14
|
+
const cartItems = cart.cartItems;
|
|
15
|
+
const hasCartItems = cartItems && cartItems.length;
|
|
16
|
+
const isCartItemsTabActive = activeTabIndex === tabIdItems;
|
|
17
|
+
const isShipmentTabActive = activeTabIndex === tabIdShipment;
|
|
18
|
+
const isCheckoutTabOpen = activeTabIndex === tabIdCheckout;
|
|
19
|
+
const isPaymentSuccessOpen = activeTabIndex === tabIdPaymentSuccess;
|
|
20
|
+
return isCheckoutTabOpen || isPaymentSuccessOpen ? (
|
|
21
|
+
<></>
|
|
22
|
+
) : isShipmentTabActive ? (
|
|
23
|
+
<ButtonShipmentTabNext />
|
|
24
|
+
) : isCartItemsTabActive && !hasCartItems ? (
|
|
25
|
+
<></>
|
|
26
|
+
) : (
|
|
27
|
+
<ButtonNext />
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default ButtonNextDynamic;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
3
|
+
import { faCircleNotch, faShoppingCart } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import Button from './Button';
|
|
5
|
+
import { useCartContext } from '../CartProvider';
|
|
6
|
+
|
|
7
|
+
const Badge = ({ color, children }: any) => {
|
|
8
|
+
return <span className={`merchi-cart-badge badge-${color}`}>{children}</span>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function ButtonOpenCart() {
|
|
12
|
+
const {
|
|
13
|
+
cart,
|
|
14
|
+
classNameCartToggleIconButton,
|
|
15
|
+
fetchingCart,
|
|
16
|
+
loading,
|
|
17
|
+
toggleCartModal,
|
|
18
|
+
} = useCartContext();
|
|
19
|
+
const cartItems = cart.cartItems || [];
|
|
20
|
+
return (
|
|
21
|
+
<Button
|
|
22
|
+
onClick={toggleCartModal}
|
|
23
|
+
className={classNameCartToggleIconButton}
|
|
24
|
+
>
|
|
25
|
+
<FontAwesomeIcon
|
|
26
|
+
icon={loading || fetchingCart ? faCircleNotch : faShoppingCart}
|
|
27
|
+
spin={loading || fetchingCart}
|
|
28
|
+
/>
|
|
29
|
+
{cartItems.length > 0 ? (
|
|
30
|
+
<Badge color='danger'>
|
|
31
|
+
{cartItems.length}
|
|
32
|
+
</Badge>
|
|
33
|
+
) : null}
|
|
34
|
+
</Button>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface Props {
|
|
39
|
+
cartButtonWrappedInContainer?: boolean;
|
|
40
|
+
listContainerClass?: string;
|
|
41
|
+
listItemClass?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function ButtonListWrappedOpenCart(props: Props) {
|
|
45
|
+
const {
|
|
46
|
+
cartButtonWrappedInContainer = true,
|
|
47
|
+
listContainerClass,
|
|
48
|
+
listItemClass,
|
|
49
|
+
} = props;
|
|
50
|
+
return (
|
|
51
|
+
cartButtonWrappedInContainer ? (
|
|
52
|
+
<ul className={listContainerClass}>
|
|
53
|
+
<li className={listItemClass}>
|
|
54
|
+
<ButtonOpenCart />
|
|
55
|
+
</li>
|
|
56
|
+
</ul>
|
|
57
|
+
) : (
|
|
58
|
+
<ButtonOpenCart />
|
|
59
|
+
)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCartContext } from '../CartProvider';
|
|
3
|
+
import { currencyMap } from '../utilities/currency';
|
|
4
|
+
import Button from './Button';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
cart: any;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function ButtonPay({ cart, loading }: Props) {
|
|
12
|
+
const { classNameBtnPay } = useCartContext();
|
|
13
|
+
const { currency, totalCost } = cart;
|
|
14
|
+
return (
|
|
15
|
+
<Button
|
|
16
|
+
className={classNameBtnPay}
|
|
17
|
+
disabled={loading}
|
|
18
|
+
type='submit'
|
|
19
|
+
>
|
|
20
|
+
{loading ? (
|
|
21
|
+
<span>Loading...</span>
|
|
22
|
+
) : (
|
|
23
|
+
<span>
|
|
24
|
+
Pay {currencyMap[currency]}
|
|
25
|
+
{totalCost}<small> / inc tax</small>
|
|
26
|
+
</span>
|
|
27
|
+
)}
|
|
28
|
+
</Button>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default ButtonPay;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { shipmentFormId } from '../utilities/shipment';
|
|
3
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
|
+
import { faArrowRight, faCircleNotch } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
+
import Button from './Button';
|
|
6
|
+
import { useCartContext } from '../CartProvider';
|
|
7
|
+
|
|
8
|
+
export default function ButtonShipmentTabNext() {
|
|
9
|
+
const { classNameBtnNext, loadingTotals } = useCartContext();
|
|
10
|
+
const icon = loadingTotals ? faCircleNotch : faArrowRight;
|
|
11
|
+
return (
|
|
12
|
+
<Button
|
|
13
|
+
className={classNameBtnNext}
|
|
14
|
+
form={shipmentFormId}
|
|
15
|
+
disabled={loadingTotals}
|
|
16
|
+
type='submit'
|
|
17
|
+
>
|
|
18
|
+
<FontAwesomeIcon icon={icon} spin={loadingTotals} />
|
|
19
|
+
<span style={{marginLeft: '5px'}}>
|
|
20
|
+
{loadingTotals ? 'Loading...' : 'Next'}
|
|
21
|
+
</span>
|
|
22
|
+
</Button>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Button from './Button';
|
|
2
|
+
import ButtonBack from './ButtonBack';
|
|
3
|
+
import ButtonClearCart from './ButtonClearCart';
|
|
4
|
+
import ButtonInvoiceDownload from './ButtonInvoiceDownload';
|
|
5
|
+
import ButtonNextDynamic from './ButtonNextDynamic';
|
|
6
|
+
import ButtonPay from './ButtonPay';
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
Button,
|
|
10
|
+
ButtonBack,
|
|
11
|
+
ButtonClearCart,
|
|
12
|
+
ButtonNextDynamic,
|
|
13
|
+
ButtonPay,
|
|
14
|
+
ButtonInvoiceDownload,
|
|
15
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCartContext } from '../CartProvider';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
alertType?: 'success' | 'danger' | 'warning' | 'info';
|
|
6
|
+
children: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function Alert({ alertType, children }: Props) {
|
|
10
|
+
const {
|
|
11
|
+
classNameAlertError,
|
|
12
|
+
classNameAlertInfo,
|
|
13
|
+
classNameAlertSuccess,
|
|
14
|
+
classNameAlertWarning,
|
|
15
|
+
} = useCartContext();
|
|
16
|
+
let className = classNameAlertInfo;
|
|
17
|
+
if (alertType === 'success') {
|
|
18
|
+
className = classNameAlertSuccess;
|
|
19
|
+
}
|
|
20
|
+
if (alertType === 'danger') {
|
|
21
|
+
className = classNameAlertError;
|
|
22
|
+
}
|
|
23
|
+
if (alertType === 'warning') {
|
|
24
|
+
className = classNameAlertWarning;
|
|
25
|
+
}
|
|
26
|
+
return (
|
|
27
|
+
<div className={`merchi-cart-modal-alert ${className}`}>
|
|
28
|
+
{children}
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCartContext } from '../CartProvider';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children: any;
|
|
6
|
+
style?: any;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export default function CartBody({ children, style }: Props) {
|
|
10
|
+
const { classNameCartBody } = useCartContext();
|
|
11
|
+
return (
|
|
12
|
+
<div className={classNameCartBody} style={style}>
|
|
13
|
+
{children}
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
primaryEmail,
|
|
4
|
+
primaryPhone,
|
|
5
|
+
} from '../utilities/user';
|
|
6
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
7
|
+
import { faUserCircle, faUserTimes } from '@fortawesome/free-solid-svg-icons';
|
|
8
|
+
import Button from '../buttons/Button';
|
|
9
|
+
import Title from './CartTitle';
|
|
10
|
+
import { useCartContext } from '../CartProvider';
|
|
11
|
+
|
|
12
|
+
export function ClientInfo({ client }: any) {
|
|
13
|
+
const { classNameListClientInfo } = useCartContext();
|
|
14
|
+
const { name = 'Returning customer' } = client;
|
|
15
|
+
const emailAddress = primaryEmail(client) || 'Email not shown';
|
|
16
|
+
const phoneNumber = primaryPhone(client) || 'Phone number not shown';
|
|
17
|
+
return (
|
|
18
|
+
<ul className={classNameListClientInfo}>
|
|
19
|
+
<li>{name}</li>
|
|
20
|
+
<li>{emailAddress}</li>
|
|
21
|
+
<li>{phoneNumber}</li>
|
|
22
|
+
</ul>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function CartClient() {
|
|
27
|
+
const {
|
|
28
|
+
cart,
|
|
29
|
+
cartClient,
|
|
30
|
+
classNameBtnDefault,
|
|
31
|
+
setCart,
|
|
32
|
+
setCartClient,
|
|
33
|
+
} = useCartContext();
|
|
34
|
+
function clearClient() {
|
|
35
|
+
setCartClient(null);
|
|
36
|
+
setCart({...cart, client: null});
|
|
37
|
+
}
|
|
38
|
+
return (
|
|
39
|
+
<div>
|
|
40
|
+
<Title icon={faUserCircle} title='Checkout as' />
|
|
41
|
+
{cartClient && <ClientInfo client={cartClient} />}
|
|
42
|
+
<Button
|
|
43
|
+
className={classNameBtnDefault}
|
|
44
|
+
onClick={clearClient}
|
|
45
|
+
>
|
|
46
|
+
<FontAwesomeIcon icon={faUserTimes} /> Change
|
|
47
|
+
</Button>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export default CartClient;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCartContext } from "../CartProvider";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
children: any;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function CartFooter({ children }: Props) {
|
|
9
|
+
const { classNameCartFooter } = useCartContext();
|
|
10
|
+
return (
|
|
11
|
+
<div className={classNameCartFooter}>
|
|
12
|
+
{children}
|
|
13
|
+
</div>
|
|
14
|
+
);
|
|
15
|
+
}
|