@weareconceptstudio/account 0.0.8 → 0.0.9

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.
@@ -1,36 +1,31 @@
1
- import React, { memo, useState, useEffect } from 'react';
2
- import { Text, useUi } from '@weareconceptstudio/core';
1
+ import React, { memo, useState } from 'react';
2
+ import { Text } from '@weareconceptstudio/core';
3
3
  import { useAccountContext } from '../../AccountProvider';
4
4
  import AccountButton from '../ui/AccountButton';
5
5
  //* Utils
6
6
  import { handlePriceCheckFunc, numToLocalString } from '../../utils/_functions';
7
7
  //* Style
8
8
  import TotalCheckoutStyle from './style';
9
- const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, itemsCount, subtotal, total, loading, shippingCost }) => {
10
- const { winWidth } = useUi();
9
+ // TODO: Note
10
+ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, itemsCount, subtotal, total, shippingCost }) => {
11
11
  const { currency } = useAccountContext();
12
12
  //! States
13
- const [headerHeight, setHeaderHeight] = useState();
14
13
  const [note, setNote] = useState();
15
- //! useEffect
16
- useEffect(() => {
17
- setHeaderHeight(document.getElementsByTagName('header')[0]?.clientHeight);
18
- }, [winWidth]);
19
- return (React.createElement(TotalCheckoutStyle, { "$headerHeight": headerHeight },
14
+ return (React.createElement(TotalCheckoutStyle, null,
20
15
  React.createElement("div", { className: `cart-main-wrap` },
21
16
  React.createElement("div", { className: `left-panel-wrap panel` }, children),
22
17
  React.createElement("div", { className: `right-panel-wrap panel ${confirmation ? 'display-none-wrap' : ''}` }, !confirmation && (React.createElement("div", { className: `max-width-wrapper sticky-wrap` },
23
- React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1`, text: `orderSummary` }),
18
+ React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-title`, text: `orderSummary` }),
24
19
  React.createElement("div", { className: `od-line` }),
25
20
  React.createElement("div", { className: `od-item-wrap` },
26
- React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1`, text: `subtotal` }),
27
- React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1`, text: itemsCount ? handlePriceCheckFunc(subtotal, currency) : `0 ${currency}` })),
21
+ React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 sticky-wrap-subtotal`, text: `subtotal` }),
22
+ React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 sticky-wrap-currency`, text: itemsCount ? handlePriceCheckFunc(subtotal, currency) : `0 ${currency}` })),
28
23
  React.createElement("div", { className: `od-item-wrap` },
29
- React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1`, text: `shipping` }),
30
- React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1`, text: `${String(shippingCost).toLowerCase() === 'free' || shippingCost === '-' ? shippingCost : `${numToLocalString(shippingCost)} ${currency}`}` })),
24
+ React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 sticky-wrap-shipping`, text: `shipping` }),
25
+ React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 sticky-wrap-shipping-cost`, text: `${String(shippingCost).toLowerCase() === 'free' || shippingCost === '-' ? shippingCost : `${numToLocalString(shippingCost)} ${currency}`}` })),
31
26
  React.createElement("div", { className: `od-item-wrap` },
32
- React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1`, text: `total` }),
33
- React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1`, text: itemsCount ? handlePriceCheckFunc(total, currency) : `0 ${currency}` })),
27
+ React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-total`, text: `total` }),
28
+ React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-currnecy2`, text: itemsCount ? handlePriceCheckFunc(total, currency) : `0 ${currency}` })),
34
29
  typeof isShipping === 'boolean' && !isShipping ? (
35
30
  // <Input.TextArea
36
31
  // value={note}
@@ -43,6 +38,6 @@ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, i
43
38
  textAlign: 'center',
44
39
  margin: '16px 0',
45
40
  }, className: 'account-p account-p3 account-font-regular account-primary-color1' }, "Input Filed Textarea")) : null,
46
- React.createElement(AccountButton, { url: buttonProps.url, btnType: `full-width`, text: buttonProps.text, type: buttonProps.type, onClick: () => buttonProps.handleClick && buttonProps.handleClick(note), className: `${!itemsCount || loading || buttonProps.disabled ? 'disabled' : ''}` })))))));
41
+ React.createElement(AccountButton, { url: buttonProps.url, btnType: `full-width`, text: buttonProps.text, type: buttonProps.type, disabled: buttonProps.disabled, onClick: () => buttonProps.handleClick && buttonProps.handleClick(note), className: `sticky-wrap-btn ${buttonProps.disabled ? 'disabled' : ''}` })))))));
47
42
  });
48
43
  export default TotalCheckout;
@@ -82,13 +82,6 @@ const TotalCheckoutStyle = styled.section `
82
82
  margin-top: var(--account_btnMTop);
83
83
  }
84
84
  }
85
-
86
- //! Sticky Wrapper
87
- .sticky-wrap {
88
- position: sticky;
89
- height: fit-content;
90
- top: calc(${(props) => props.$headerHeight}px + var(--account_cartMainWrapPadTop));
91
- }
92
85
  }
93
86
  }
94
87
 
@@ -6,8 +6,8 @@ import EmptyCartStyle from './style';
6
6
  const EmptyCart = ({ shoppingUrl }) => {
7
7
  return (React.createElement(EmptyCartStyle, null,
8
8
  React.createElement("div", { className: `empty-cart-wrap` },
9
- React.createElement(Text, { tag: `h4`, className: `account-h4 account-font-bold account-primary-color1`, text: `cartEmpty` }),
10
- React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 description`, text: `cartEmptyDesc` }),
11
- shoppingUrl ? (React.createElement(AccountButton, { btnType: 'purple-text', text: `shopNow`, url: shoppingUrl })) : null)));
9
+ React.createElement(Text, { tag: `h4`, className: `account-h4 account-font-bold account-primary-color1 empty-cart-title`, text: `cartEmpty` }),
10
+ React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 empty-cart-description`, text: `cartEmptyDesc` }),
11
+ shoppingUrl ? (React.createElement(AccountButton, { text: `shopNow`, url: shoppingUrl, btnType: 'purple-text', className: 'empty-cart-btn' })) : null)));
12
12
  };
13
13
  export default EmptyCart;
@@ -8,7 +8,7 @@ const EmptyCartStyle = styled.section `
8
8
  max-width: var(--account_emptyCartWrapMaxWidth);
9
9
  width: 100%;
10
10
 
11
- .description {
11
+ .empty-cart-description {
12
12
  margin-top: var(--account_descriptionMTop);
13
13
  }
14
14
 
@@ -1,12 +1,11 @@
1
1
  import React, { memo, useMemo } from 'react';
2
2
  import { Image, Text } from '@weareconceptstudio/core';
3
3
  import { Select } from '@weareconceptstudio/form';
4
- import { useAccountContext } from '../../../../../AccountProvider';
5
4
  import { handlePriceCheckFunc } from '../../../../../utils/_functions';
6
5
  import Button from '../../../../ui/AccountButton';
6
+ //TODO: Fake
7
7
  const pathname = '/cart/';
8
- const Item = memo(({ data, remove, select, isLast, actions }) => {
9
- const { currency, maxQty } = useAccountContext();
8
+ const Item = memo(({ data, remove, select, isLast, actions, maxQty, currency }) => {
10
9
  const selectionList = useMemo(() => {
11
10
  if (select) {
12
11
  const selectList = [];
@@ -23,7 +22,7 @@ const Item = memo(({ data, remove, select, isLast, actions }) => {
23
22
  React.createElement("div", { className: `image-wrapper` },
24
23
  React.createElement(Image, { src: data?.product?.image?.src, alt: data?.product?.image?.alt })),
25
24
  React.createElement("div", { className: `col-1-right-wrap` },
26
- React.createElement(Button, { url: data.product?.url, className: `capitalize`, text: data.product?.name, btnType: `green-large-text`, target: pathname === '/cart/' || pathname === '/checkout' ? '_blank' : '_self' }),
25
+ React.createElement(Button, { url: data.product?.url, text: data.product?.name, btnType: `green-large-text`, className: `capitalize title-btn`, target: pathname === '/cart/' || pathname === '/checkout' ? '_blank' : '_self' }),
27
26
  React.createElement("div", { className: `right-first-item-wrap` },
28
27
  React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1 capitalize`, text: data.product.short_info_1 })),
29
28
  React.createElement("div", { className: `right-second-item-wrap` },
@@ -33,15 +32,15 @@ const Item = memo(({ data, remove, select, isLast, actions }) => {
33
32
  qty: val,
34
33
  }) })) : (React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: data.qty })))) : (React.createElement(Text, { className: `account-p account-p3 account-font-medium account-primary-color1`, text: data.qty }))),
35
34
  React.createElement("div", { className: `col-item tl-col-3 col-item-3 nowrap` }, data?.product?.sale_price ? (React.createElement("div", null,
36
- React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 alignRight`, text: handlePriceCheckFunc(data?.product?.sale_price, currency) }),
37
- React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through value align-right`, text: handlePriceCheckFunc(data.product?.price, currency) }))) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 alignRight`, text: handlePriceCheckFunc(data.product?.price, currency) }))),
35
+ React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 align-right cart-sale-price`, text: handlePriceCheckFunc(data?.product?.sale_price, currency) }),
36
+ React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through value align-right cart-price1`, text: handlePriceCheckFunc(data.product?.price, currency) }))) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 align-right cart-price2`, text: handlePriceCheckFunc(data.product?.price, currency) }))),
38
37
  React.createElement("div", { className: `col-item tl-col-4 col-item-4 nowrap` },
39
38
  React.createElement("div", { className: `col-item-inner-wrap` },
40
39
  React.createElement("div", { className: `flex-end-wrap` }, data?.product.sale_price ? (React.createElement("div", null,
41
- React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 align-right`, text: `${data.sale_total} ${currency}` }),
42
- React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through value align-right`, text: handlePriceCheckFunc(data.product?.price * data.qty, currency) }))) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 align-right`, text: `${data.total} ${currency}` }))),
40
+ React.createElement(Text, { className: `account-p account-p3 account-font-bold account-secondary-color2 align-right cart-sale-total`, text: `${data.sale_total} ${currency}` }),
41
+ React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color2 line-through value align-right cart-total1`, text: handlePriceCheckFunc(data.product?.price * data.qty, currency) }))) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 align-right cart-total2`, text: `${data.total} ${currency}` }))),
43
42
  React.createElement("div", { className: `favorite-and-remove-wrap` }, remove && (React.createElement("div", { className: `remove-btn-wrap` },
44
- React.createElement(Button, { text: 'remove', btnType: `green-small-text`, onClick: () => actions.delete({ productId: data.product?.id }) }))))))),
43
+ React.createElement(Button, { text: 'remove', btnType: `green-small-text`, className: 'cart-remove-btn', onClick: () => actions.delete({ productId: data.product?.id }) }))))))),
45
44
  isLast ? React.createElement("div", { className: 'line' }) : null));
46
45
  });
47
46
  export default Item;
@@ -1,26 +1,20 @@
1
1
  import React, { memo, useMemo } from 'react';
2
- import { Image, Text, useUi } from '@weareconceptstudio/core';
2
+ import { Image, Text } from '@weareconceptstudio/core';
3
3
  import { Select } from '@weareconceptstudio/form';
4
4
  import Button from '../../../../ui/AccountButton';
5
- import { useAccountContext } from '../../../../../AccountProvider';
6
5
  import { handlePriceCheckFunc } from '../../../../../utils/_functions';
7
- // import ProductIndividual from '@/components/common/ProductIndividual';
8
6
  //TODO: Fake
9
7
  const pathname = '/cart/';
10
- const addToCart = () => { };
11
- const removeCart = () => { };
12
- const ItemMobile = memo(({ data, additionalParameters, isLast }) => {
13
- const { openPopup } = useUi();
14
- const { currency } = useAccountContext();
8
+ const ItemMobile = memo(({ data, remove, select, isLast, actions, maxQty, currency }) => {
15
9
  const selectionList = useMemo(() => {
16
- if (additionalParameters.select) {
10
+ if (select) {
17
11
  const selectList = [];
18
- for (let index = 1; index <= data.qty; index++) {
12
+ for (let index = 1; index <= maxQty; index++) {
19
13
  selectList.push({ id: index, name: index });
20
14
  }
21
15
  return selectList;
22
16
  }
23
- }, [data]);
17
+ }, [data, select, maxQty]);
24
18
  return (React.createElement(React.Fragment, null,
25
19
  isLast ? React.createElement("div", { className: 'line' }) : null,
26
20
  React.createElement("div", { className: `mobile-order-item-wrap` },
@@ -28,18 +22,14 @@ const ItemMobile = memo(({ data, additionalParameters, isLast }) => {
28
22
  React.createElement("div", { className: `mobile-image-wrap` },
29
23
  React.createElement(Image, { src: data?.images?.[0].src, alt: data?.images?.[0].alt })),
30
24
  React.createElement("div", { className: `mobile-info-wrap` },
31
- React.createElement(Button, { className: `capitalize`, url: data.product?.url, btnType: `green-large-text`, text: data.product?.name || data.name, target: pathname === '/cart/' || pathname === '/checkout/' ? '_blank' : '_self' }),
32
- additionalParameters.select ? (React.createElement("div", { className: `select-and-out-of-stock-mobile-wrap` }, !data.product?.out_of_stock ? (
33
- // <FormSelect
34
- // list={selectionList}
35
- // selectedValue={data.qty}
36
- // className={`quantity-select-mobile-wrap`}
37
- // onChange={(val) => addToCart({ productId: data.product.id, variantId: data.selectedVariant.id, optionId: data.selectedOption.id, qty: val, update: true })}
38
- // />
39
- React.createElement(Select, { allowSearch: false, options: selectionList, value: 1, onChange: () => { } })) : (React.createElement("div", { className: `mobile-info-item` },
25
+ React.createElement(Button, { url: data.product?.url, btnType: `green-large-text`, text: data.product?.name || data.name, className: `capitalize mobile-info-wrap-title`, target: pathname === '/cart/' || pathname === '/checkout/' ? '_blank' : '_self' }),
26
+ select ? (React.createElement("div", { className: `select-and-out-of-stock-mobile-wrap` }, !data.product?.out_of_stock ? (React.createElement(Select, { allowSearch: false, options: selectionList, value: data.qty, onChange: (val) => actions.add({
27
+ productId: data.product.id,
28
+ qty: val,
29
+ }) })) : (React.createElement("div", { className: `mobile-info-item` },
40
30
  React.createElement(Text, { className: `account-p account-p3 account-font-medium primaryColor1`, text: `quantityWithSymbol` }),
41
31
  "\u00A0",
42
- React.createElement(Text, { className: `account-p account-p3 account-font-medium primaryColor1`, text: data.qty }))))) : (React.createElement("div", { className: `mobile-info-item` },
32
+ React.createElement(Text, { className: `account-p account-p3 account-font-medium primaryColor1`, text: data.qty || data.quantity }))))) : (React.createElement("div", { className: `mobile-info-item` },
43
33
  React.createElement(Text, { className: `account-p account-p3 account-font-medium primaryColor1`, text: `quantityWithSymbol` }),
44
34
  "\u00A0",
45
35
  React.createElement(Text, { className: `account-p account-p3 account-font-medium primaryColor1`, text: data.qty || data.quantity }))),
@@ -54,7 +44,7 @@ const ItemMobile = memo(({ data, additionalParameters, isLast }) => {
54
44
  React.createElement(Text, { className: `account-p account-p3 account-font-bold secondaryColor2`, text: handlePriceCheckFunc(data.product?.discountedPrice * data.qty, currency) }),
55
45
  React.createElement(Text, { className: `account-p account-p3 account-font-regular primaryColor2 lineThrough`, text: handlePriceCheckFunc(data.product?.price * data.qty, currency) }))) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold primaryColor1`, text: handlePriceCheckFunc(data.product?.price * data.qty || data.total, currency || currency) }))))),
56
46
  pathname === '/cart/' && (React.createElement("div", { className: `edit-remove-favorite-mobile-wrap` },
57
- React.createElement("div", { className: `favorite-remove-mobile-wrap` }, additionalParameters.remove && (React.createElement(Button, { text: 'remove', btnType: `green-small-text`, onClick: () => removeCart({ productId: data.product.id, variantId: data.selectedVariant.id, optionId: data.selectedOption.id }) })))))),
47
+ React.createElement("div", { className: `favorite-remove-mobile-wrap` }, remove && (React.createElement(Button, { text: 'remove', btnType: `green-small-text`, onClick: () => actions.delete({ productId: data.product?.id }) })))))),
58
48
  React.createElement("div", { className: 'line' })));
59
49
  });
60
50
  export default ItemMobile;
@@ -3,9 +3,10 @@ import { Text, useUi } from '@weareconceptstudio/core';
3
3
  //* Components
4
4
  import Item from './Item';
5
5
  import ItemMobile from './ItemMobile';
6
+ import Button from '../../../ui/AccountButton';
6
7
  //* Style
7
8
  import CartItemsStyle from './style';
8
- const CartItems = memo(({ data, className, title, smallFontSize, additionalParameters, currency, isLast, actions }) => {
9
+ const CartItems = memo(({ data, className, title, smallFontSize, additionalParameters, actions, currency, maxQty }) => {
9
10
  const { winWidth } = useUi();
10
11
  //! Store
11
12
  const orderStore = useMemo(() => {
@@ -16,20 +17,20 @@ const CartItems = memo(({ data, className, title, smallFontSize, additionalParam
16
17
  React.createElement("div", { className: `title-wrap tl-col-2` },
17
18
  React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 nowrap`, text: `quantity` })),
18
19
  React.createElement("div", { className: `title-wrap tl-col-3 title-item` },
19
- React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 nowrap alignRight`, text: `price` })),
20
+ React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 nowrap align-right`, text: `price` })),
20
21
  React.createElement("div", { className: `title-wrap tl-col-4 title-item` },
21
- React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 nowrap alignRight`, text: `total` }))),
22
+ React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 nowrap align-right`, text: `total` }))),
22
23
  React.createElement("div", { className: `items-wrap` }, data?.map((item, index) => {
23
- return (React.createElement(Item, { key: index, data: item, currency: currency, isLast: data.length - 1 == index, select: additionalParameters.select, remove: additionalParameters.remove, edit: additionalParameters.edit.item, actions: actions }));
24
+ return (React.createElement(Item, { key: index, data: item, maxQty: maxQty, actions: actions, currency: currency, isLast: data.length - 1 == index, select: additionalParameters.select, remove: additionalParameters.remove, edit: additionalParameters.edit.item }));
24
25
  })))) : (React.createElement("div", { className: `mobile-order-items-table-wrap` }, data?.map((item, index) => {
25
- return (React.createElement(ItemMobile, { key: index, data: item, isLast: isLast, currency: currency, additionalParameters: additionalParameters }));
26
+ return (React.createElement(ItemMobile, { key: index, data: item, maxQty: maxQty, actions: actions, currency: currency, isLast: data.length - 1 == index, select: additionalParameters.select, remove: additionalParameters.remove, edit: additionalParameters.edit.item }));
26
27
  })));
27
- }, [winWidth, data, additionalParameters, currency]);
28
+ }, [winWidth, data, additionalParameters, currency, actions, maxQty]);
28
29
  return (React.createElement(CartItemsStyle, { className: className || '' },
29
30
  additionalParameters.edit.list ? (React.createElement("div", { className: `title-edit-wrapper` },
30
- React.createElement(Text, { className: `p ${smallFontSize ? 'p2' : 'p1'} account-font-bold account-primary-color1`, text: title }),
31
- React.createElement(Button, { url: '/cart/', text: `editCart`, btnType: `green-small-text` }))) : (React.createElement(Text, { className: `p ${smallFontSize ? 'p2' : 'p1'} account-font-bold account-primary-color1`, text: title })),
32
- additionalParameters.horizontalLine && React.createElement("div", { className: `order-items-line` }),
31
+ React.createElement(Text, { className: `account-p ${smallFontSize ? 'account-p2' : 'account-p1'} account-font-bold account-primary-color1 cart-items-title2-version`, text: title }),
32
+ React.createElement(Button, { url: '/cart/', text: `editCart`, btnType: `green-small-text`, className: 'cart-items-edit-btn' }))) : (React.createElement(Text, { className: `account-p ${smallFontSize ? 'account-p2' : 'account-p1'} account-font-bold account-primary-color1 cart-items-title1-version`, text: title })),
33
+ additionalParameters.horizontalLine ? React.createElement("div", { className: `order-items-line` }) : null,
33
34
  orderStore));
34
35
  });
35
36
  export default CartItems;
@@ -132,6 +132,13 @@ const CartItemsStyle = styled.section `
132
132
  flex: 1;
133
133
  margin-left: var(--col1RightWrapML);
134
134
 
135
+ .title-btn {
136
+ a,
137
+ button {
138
+ text-align: left;
139
+ }
140
+ }
141
+
135
142
  .btn-wrap {
136
143
  margin-bottom: 0 !important;
137
144
  }
@@ -251,7 +258,7 @@ const CartItemsStyle = styled.section `
251
258
  }
252
259
  }
253
260
 
254
- @media only screen and (max-width: ${(props) => props.theme.mediaQuery.DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.mediaQuery.DesktopSizeL}) {
261
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
255
262
  --spaceLineMTop: var(--sp2x);
256
263
  --spaceLineMBot: var(--sp4x);
257
264
 
@@ -295,7 +302,7 @@ const CartItemsStyle = styled.section `
295
302
  }
296
303
  }
297
304
 
298
- @media only screen and (max-width: ${(props) => props.theme.mediaQuery.DesktopSizeLMin}) and (min-width: ${(props) => props.theme.mediaQuery.DesktopSizeM}) {
305
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
299
306
  --spaceLineMTop: var(--sp2x);
300
307
  --spaceLineMBot: var(--sp4x);
301
308
 
@@ -339,7 +346,7 @@ const CartItemsStyle = styled.section `
339
346
  }
340
347
  }
341
348
 
342
- @media only screen and (max-width: ${(props) => props.theme.mediaQuery.DesktopSizeMMin}) and (min-width: ${(props) => props.theme.mediaQuery.DesktopSizeS}) {
349
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
343
350
  --spaceLineMTop: var(--sp2x);
344
351
  --spaceLineMBot: var(--sp3x);
345
352
 
@@ -383,7 +390,7 @@ const CartItemsStyle = styled.section `
383
390
  }
384
391
  }
385
392
 
386
- @media only screen and (max-width: ${(props) => props.theme.mediaQuery.DesktopSizeSMin}) and (min-width: ${(props) => props.theme.mediaQuery.DesktopSizeXS}) {
393
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
387
394
  --spaceLineMTop: var(--sp2x);
388
395
  --spaceLineMBot: var(--sp3x);
389
396
 
@@ -428,7 +435,7 @@ const CartItemsStyle = styled.section `
428
435
  }
429
436
  }
430
437
 
431
- @media only screen and (max-width: ${(props) => props.theme.mediaQuery.DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.mediaQuery.TabletSize}) {
438
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
432
439
  --spaceLineMTop: var(--sp2x);
433
440
  --spaceLineMBot: var(--sp3x);
434
441
 
@@ -474,7 +481,7 @@ const CartItemsStyle = styled.section `
474
481
  }
475
482
  }
476
483
 
477
- @media only screen and (max-width: ${(props) => props.theme.mediaQuery.TabletSizeMin}) and (min-width: ${(props) => props.theme.mediaQuery.TabletSizeS}) {
484
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
478
485
  --spaceLineMTop: var(--sp2x);
479
486
  --spaceLineMBot: var(--sp2x);
480
487
 
@@ -519,7 +526,7 @@ const CartItemsStyle = styled.section `
519
526
  }
520
527
  }
521
528
 
522
- @media only screen and (max-width: ${(props) => props.theme.mediaQuery.TabletSizeSMin}) {
529
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
523
530
  --spaceLineMTop: var(--sp2x);
524
531
  --spaceLineMBot: 0;
525
532
  --orderItemsMarTop: var(--sp6x);
@@ -1,4 +1,4 @@
1
- import React, { memo, useMemo } from 'react';
1
+ import React, { memo, useCallback, useMemo } from 'react';
2
2
  import classNames from 'classnames';
3
3
  import { Link, useTranslation } from '@weareconceptstudio/core';
4
4
  import { useTheme } from 'styled-components';
@@ -14,7 +14,10 @@ const AccountButton = memo(({ btnType, text, className, onClick, children, url,
14
14
  [btnType]: btnType,
15
15
  [className]: className,
16
16
  });
17
- return (React.createElement(AccountButtonStyle, { onClick: onClick, className: classString, theme: theme(globalTheme) },
17
+ const handleClick = useCallback(() => {
18
+ return !disabled && onClick?.();
19
+ }, [onClick, disabled]);
20
+ return (React.createElement(AccountButtonStyle, { onClick: handleClick, className: classString, theme: theme(globalTheme) },
18
21
  React.createElement(Component, { ...customProps },
19
22
  svg_icon || children || translate(text),
20
23
  " ")));
@@ -164,10 +164,12 @@ const AccountButtonStyle = styled.div `
164
164
  }
165
165
 
166
166
  &.disabled {
167
+ pointer-events: none;
168
+ opacity: 0.5;
169
+
167
170
  button,
168
171
  a {
169
172
  pointer-events: none;
170
- opacity: 0.5;
171
173
  }
172
174
  }
173
175
 
@@ -16,7 +16,7 @@ const AccountTemplate = ({ isFullWidth = false, menuOptions = [], children, onSi
16
16
  React.createElement(Text, { tag: `span`, className: `account-p account-p1 account-font-bold sidebar-item`, text: menuItem.name }))));
17
17
  }, [menuOptions]);
18
18
  return (React.createElement(Page, { className: 'account use-account' },
19
- React.createElement(AccountStyle, null,
19
+ React.createElement(AccountStyle, { className: 'account-container' },
20
20
  React.createElement("div", { className: 'account-wrap' },
21
21
  React.createElement("aside", { className: 'sidebar' },
22
22
  React.createElement("div", { className: `sidebar-inner-wrap` },
@@ -33,12 +33,6 @@ const AccountStyle = styled.section `
33
33
  width: var(--account_sidebarWidth);
34
34
  padding: 0 calc(var(--account_colDistance) / 2);
35
35
 
36
- //! Sticky Styles
37
- .sidebar-inner-wrap {
38
- position: sticky;
39
- top: calc(var(--account_accountPadT) + ${(props) => props.$headerHeight}px);
40
- }
41
-
42
36
  .my-acc-wrap {
43
37
  .account-line {
44
38
  width: var(--account_accountLineWidth);
@@ -1,25 +1,27 @@
1
1
  import React from 'react';
2
2
  import { Container, Page } from '@weareconceptstudio/core';
3
3
  import { EmptyCart, TotalCheckout, AccountButton, SimpleCartItems } from '../../components';
4
- import CartTemplateStyle from './style';
5
4
  import { useAccountContext } from '../../AccountProvider';
5
+ //* Styles
6
+ import CartTemplateStyle from './style';
6
7
  const CartTemplate = ({ items, itemsCount, shippingCost, loading, children, subtotal, total, actions, btnDisabled, checkoutUrl = '/checkout/' }) => {
7
8
  const { shopUrl } = useAccountContext();
9
+ const { maxQty, currency } = useAccountContext();
8
10
  return (React.createElement(Page, { className: 'cart use-account' },
9
11
  React.createElement(Container, null,
10
12
  React.createElement(CartTemplateStyle, null,
11
13
  React.createElement(TotalCheckout, { total: total, subtotal: subtotal, itemsCount: itemsCount, shippingCost: shippingCost, buttonProps: {
12
14
  url: checkoutUrl,
13
- text: 'proceedToCheckout',
14
15
  disabled: btnDisabled,
16
+ text: 'proceedToCheckout',
15
17
  } }, itemsCount > 0 ? (React.createElement(React.Fragment, null,
16
- React.createElement(SimpleCartItems, { data: items, smallFontSize: true, title: 'myCart', className: `cart-st-wrap`, additionalParameters: {
17
- edit: { list: false },
18
+ React.createElement(SimpleCartItems, { data: items, smallFontSize: true, maxQty: maxQty, title: 'myCart', actions: actions, currency: currency, className: `cart-st-wrap`, additionalParameters: {
18
19
  remove: true,
19
- horizontalLine: true,
20
20
  select: true,
21
- }, actions: actions }),
22
- shopUrl ? (React.createElement(AccountButton, { btnType: `purple-text`, text: `continueShopping`, className: `continue-shop-text`, url: shopUrl })) : null)) : (!loading && (React.createElement(EmptyCart, { data: items, shoppingUrl: shopUrl })))),
21
+ horizontalLine: true,
22
+ edit: { list: false },
23
+ } }),
24
+ shopUrl ? (React.createElement(AccountButton, { url: shopUrl, btnType: `purple-text`, text: `continueShopping`, className: `continue-shop-text` })) : null)) : (!loading && (React.createElement(EmptyCart, { data: items, shoppingUrl: shopUrl })))),
23
25
  children))));
24
26
  };
25
27
  export default CartTemplate;
@@ -1,3 +1,5 @@
1
1
  export default StepReview;
2
- declare function StepReview(): React.JSX.Element;
2
+ declare function StepReview({ items }: {
3
+ items: any;
4
+ }): React.JSX.Element;
3
5
  import React from 'react';
@@ -1,8 +1,16 @@
1
1
  import React from 'react';
2
2
  import { SelectShippingBilling, useAddressContext } from '../../../modules';
3
3
  import SelectAddress from '../../../modules/address/SelectAddress';
4
- const StepReview = () => {
4
+ import { SimpleCartItems } from '../../../components';
5
+ const StepReview = ({ items }) => {
5
6
  const { hasAddressType } = useAddressContext();
6
- return React.createElement("div", { className: 'step-review' }, hasAddressType ? React.createElement(SelectShippingBilling, null) : React.createElement(SelectAddress, { title: 'addresses' }));
7
+ return (React.createElement("div", { className: 'step-review' },
8
+ hasAddressType ? React.createElement(SelectShippingBilling, null) : React.createElement(SelectAddress, { title: 'addresses' }),
9
+ React.createElement(SimpleCartItems, { data: items, smallFontSize: true, title: 'orderItems', className: `checkout-mt`, additionalParameters: {
10
+ remove: false,
11
+ select: false,
12
+ horizontalLine: false,
13
+ edit: { item: false, list: true },
14
+ } })));
7
15
  };
8
16
  export default StepReview;
@@ -1,6 +1,7 @@
1
1
  export default CheckoutTemplate;
2
- declare function CheckoutTemplate({ itemsCount, total, subtotal, shippingCost, currency }: {
2
+ declare function CheckoutTemplate({ itemsCount, items, total, subtotal, shippingCost, currency }: {
3
3
  itemsCount: any;
4
+ items: any;
4
5
  total: any;
5
6
  subtotal: any;
6
7
  shippingCost: any;
@@ -5,7 +5,7 @@ import { Sequence, TotalCheckout } from '../../components';
5
5
  import StepShipping from './StepShipping';
6
6
  import StepReview from './StepReview';
7
7
  import CheckoutTemplateStyle from './style';
8
- const CheckoutTemplate = ({ itemsCount, total, subtotal, shippingCost, currency }) => {
8
+ const CheckoutTemplate = ({ itemsCount, items, total, subtotal, shippingCost, currency }) => {
9
9
  const { hasCheckoutAddress } = useAddressContext();
10
10
  const firstStepFormRef = useRef();
11
11
  const checkStep = {
@@ -22,15 +22,14 @@ const CheckoutTemplate = ({ itemsCount, total, subtotal, shippingCost, currency
22
22
  return (React.createElement(Page, { className: 'checkout use-account' },
23
23
  React.createElement(Container, null,
24
24
  React.createElement(CheckoutTemplateStyle, null,
25
- React.createElement(TotalCheckout, { total: total, subtotal: subtotal, currency: currency, shippingCost: shippingCost, isShipping: checkStep.isShipping, itemsCount: itemsCount, buttonProps: {
26
- disabled: false,
27
- loading: false,
25
+ React.createElement(TotalCheckout, { total: total, subtotal: subtotal, currency: currency, itemsCount: itemsCount, shippingCost: shippingCost, isShipping: checkStep.isShipping, buttonProps: {
28
26
  url: false,
27
+ disabled: false,
28
+ handleClick: handleCheckoutBtn,
29
29
  type: checkStep.isShipping ? 'submit' : 'button',
30
30
  text: checkStep.isShipping ? 'proceedToCheckout' : 'proceedToPayment',
31
- handleClick: handleCheckoutBtn,
32
31
  } },
33
32
  React.createElement(Sequence, { step: checkStep.isShipping ? 'shipping' : 'review' }),
34
- checkStep.isShipping ? React.createElement(StepShipping, { firstStepFormRef: firstStepFormRef }) : React.createElement(StepReview, null))))));
33
+ checkStep.isShipping ? React.createElement(StepShipping, { firstStepFormRef: firstStepFormRef }) : React.createElement(StepReview, { items: items }))))));
35
34
  };
36
35
  export default CheckoutTemplate;