@weareconceptstudio/account 0.3.4 → 0.3.6

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.
Files changed (52) hide show
  1. package/dist/AccountProvider.js +23 -1
  2. package/dist/components/AccountButton/index.js +6 -4
  3. package/dist/components/AccountButton/style.js +61 -1
  4. package/dist/components/Loader/index.d.ts +4 -1
  5. package/dist/components/Loader/index.js +19 -3
  6. package/dist/components/Loader/style.js +152 -1
  7. package/dist/components/TotalCheckout/BalanceComp/index.d.ts +10 -0
  8. package/dist/components/TotalCheckout/{MuramoneyComp → BalanceComp}/index.js +10 -10
  9. package/dist/{modules/payment/PaymentComp → components/TotalCheckout/BalanceComp}/style.d.ts +2 -2
  10. package/dist/components/TotalCheckout/{MuramoneyComp → BalanceComp}/style.js +30 -30
  11. package/dist/components/TotalCheckout/index.js +8 -8
  12. package/dist/components/TotalCheckout/style.js +4 -4
  13. package/dist/modules/account/AccountTemplate/index.js +2 -0
  14. package/dist/modules/account/AccountTemplate/style.js +29 -0
  15. package/dist/modules/checkout/CheckoutTemplate/StepReview/index.js +2 -2
  16. package/dist/modules/checkout/CheckoutTemplate/index.js +15 -3
  17. package/dist/modules/payment/AddNewCard/index.d.ts +2 -1
  18. package/dist/modules/payment/AddNewCard/index.js +5 -5
  19. package/dist/modules/payment/{CardComp → Card}/index.d.ts +3 -2
  20. package/dist/modules/payment/{CardComp → Card}/index.js +8 -13
  21. package/dist/modules/payment/Card/style.d.ts +2 -0
  22. package/dist/modules/payment/{CardComp → Card}/style.js +2 -2
  23. package/dist/modules/payment/{PaymentComp → Payment}/index.d.ts +2 -2
  24. package/dist/modules/payment/Payment/index.js +34 -0
  25. package/dist/modules/payment/Payment/style.d.ts +2 -0
  26. package/dist/modules/payment/{PaymentComp → Payment}/style.js +2 -2
  27. package/dist/modules/payment/PaymentMethodItem/index.d.ts +9 -0
  28. package/dist/modules/payment/PaymentMethodItem/index.js +29 -0
  29. package/dist/modules/payment/PaymentMethodItem/style.d.ts +2 -0
  30. package/dist/modules/payment/{PaymentMethodsComp → PaymentMethodItem}/style.js +37 -53
  31. package/dist/modules/payment/PaymentMethods/index.d.ts +7 -0
  32. package/dist/modules/payment/PaymentMethods/index.js +15 -0
  33. package/dist/modules/payment/PaymentMethods/style.d.ts +2 -0
  34. package/dist/modules/payment/PaymentMethods/style.js +46 -0
  35. package/dist/modules/payment/PaymentMethodsTemplate/index.js +12 -3
  36. package/dist/modules/payment/PaymentWrap/index.d.ts +2 -1
  37. package/dist/modules/payment/PaymentWrap/index.js +7 -7
  38. package/dist/modules/payment/SelectPaymentMethodPopup/index.js +1 -1
  39. package/dist/modules/payment/SelectedPayment/index.d.ts +3 -0
  40. package/dist/modules/payment/SelectedPayment/index.js +45 -0
  41. package/package.json +1 -1
  42. package/dist/components/TotalCheckout/MuramoneyComp/index.d.ts +0 -10
  43. package/dist/components/TotalCheckout/MuramoneyComp/style.d.ts +0 -2
  44. package/dist/modules/payment/CardComp/style.d.ts +0 -2
  45. package/dist/modules/payment/PaymentComp/index.js +0 -17
  46. package/dist/modules/payment/PaymentMethodsComp/index.d.ts +0 -8
  47. package/dist/modules/payment/PaymentMethodsComp/index.js +0 -86
  48. package/dist/modules/payment/PaymentMethodsComp/style.d.ts +0 -2
  49. /package/dist/components/TotalCheckout/{MuramoneyComp → BalanceComp}/utils.d.ts +0 -0
  50. /package/dist/components/TotalCheckout/{MuramoneyComp → BalanceComp}/utils.js +0 -0
  51. /package/dist/modules/payment/{PaymentMethodsComp/icons.d.ts → icons.d.ts} +0 -0
  52. /package/dist/modules/payment/{PaymentMethodsComp/icons.js → icons.js} +0 -0
@@ -18,6 +18,28 @@ export const useAccountContext = () => {
18
18
  export const AccountProvider = ({ fontFamily = 'core_Font', shopUrl = '/', children, maxQty = 99, currency, addressType, addressFormFields, useUser, useCart, productPopup, productUrlPrefix }) => {
19
19
  const { addTranslation } = useTranslation();
20
20
  const { openPopup } = useUi();
21
+ const paymentOptions = [
22
+ {
23
+ label: 'Cash',
24
+ value: 'cash_on_delivery',
25
+ },
26
+ {
27
+ label: 'Idram',
28
+ value: 'idram',
29
+ },
30
+ {
31
+ label: 'POS TERMINAL',
32
+ value: 'pos_terminal',
33
+ },
34
+ {
35
+ label: 'Telcell',
36
+ value: 'telcell',
37
+ },
38
+ {
39
+ label: 'Inecopay',
40
+ value: 'inecopay',
41
+ },
42
+ ];
21
43
  useEffect(() => {
22
44
  addTranslation(translations, 'prepend');
23
45
  }, []);
@@ -29,7 +51,7 @@ export const AccountProvider = ({ fontFamily = 'core_Font', shopUrl = '/', child
29
51
  openPopup(productPopup, { ...product, className: 'popup-product-block' });
30
52
  }
31
53
  }, [productUrlPrefix, productPopup]);
32
- return (React.createElement(AccountContext.Provider, { value: { currency, maxQty, shopUrl, useUser, useCart, handleProductClick } },
54
+ return (React.createElement(AccountContext.Provider, { value: { currency, maxQty, shopUrl, useUser, useCart, handleProductClick, paymentOptions } },
33
55
  React.createElement(CheckoutProvider, null,
34
56
  React.createElement(AddressProvider, { useUser: useUser, useCart: useCart, addressType: addressType, addressFormFields: addressFormFields },
35
57
  React.createElement(ThemeProvider, { theme: theme },
@@ -3,21 +3,23 @@ import classNames from 'classnames';
3
3
  import { Link, useTranslation } from '@weareconceptstudio/core';
4
4
  import AccountButtonStyle from './style';
5
5
  const AccountButton = (props) => {
6
- const { btnType, text, className, onClick, children, url, customLinkProps, target, type = 'button', disabled = false, svg_icon } = props;
6
+ const { btnType, text, className, onClick, children, url, customLinkProps, target, type = 'button', disabled = false, svg_icon, loading = false } = props;
7
7
  const { translate } = useTranslation();
8
8
  const Component = useMemo(() => (url ? Link : 'button'), [url]);
9
9
  const customProps = useMemo(() => (url ? { ...customLinkProps, url, target } : { type, disabled }), [url, type, disabled]);
10
10
  const classString = classNames('btn-wrap', {
11
11
  [btnType]: btnType,
12
12
  [className]: className,
13
+ 'loading': loading,
13
14
  'disabled': disabled,
14
15
  });
15
16
  const handleClick = useCallback(() => {
16
17
  return !disabled && onClick?.();
17
18
  }, [onClick, disabled]);
18
- return (React.createElement(AccountButtonStyle, { onClick: handleClick, className: classString },
19
+ return (React.createElement(AccountButtonStyle, { onClick: handleClick, className: `${classString} ` },
19
20
  React.createElement(Component, { ...customProps },
20
- svg_icon || children || translate(text),
21
- " ")));
21
+ loading ? (React.createElement("div", { className: 'outside-wrapper-loader' },
22
+ React.createElement("div", { className: 'loader' }))) : null,
23
+ React.createElement("div", { className: `content-button ${loading ? 'loading' : ''}` }, svg_icon || children || translate(text)))));
22
24
  };
23
25
  export default AccountButton;
@@ -18,6 +18,7 @@ const AccountButtonStyle = styled.div `
18
18
 
19
19
  button,
20
20
  a {
21
+ position: relative;
21
22
  width: 100%;
22
23
  cursor: pointer;
23
24
  font-size: var(--account_p2);
@@ -182,7 +183,7 @@ const AccountButtonStyle = styled.div `
182
183
  }
183
184
 
184
185
  &.promo-code-version,
185
- &.muramoney-version {
186
+ &.balance-version {
186
187
  width: fit-content;
187
188
 
188
189
  a,
@@ -217,6 +218,65 @@ const AccountButtonStyle = styled.div `
217
218
  }
218
219
  }
219
220
 
221
+ .content-button {
222
+ transition: opacity 0.3s ease-out;
223
+ }
224
+
225
+ &.loading {
226
+ pointer-events: none;
227
+ cursor: default;
228
+
229
+ .content-button {
230
+ &.loading {
231
+ opacity: 0;
232
+ }
233
+ }
234
+ }
235
+
236
+ .outside-wrapper-loader {
237
+ position: absolute;
238
+ width: 100%;
239
+ display: flex;
240
+ align-items: center;
241
+ justify-content: center;
242
+ height: calc(100% - var(--account_btnPadTB) * 2);
243
+ }
244
+
245
+ .loader {
246
+ /* width: var(--sp4x); */
247
+ height: 100%;
248
+ aspect-ratio: 1;
249
+ display: grid;
250
+ border-radius: 50%;
251
+ background:
252
+ linear-gradient(0deg, rgb(255 255 255/50%) 30%, transparent 0 70%, rgb(255 255 255/100%) 0) 50%/8% 100%,
253
+ linear-gradient(90deg, rgb(255 255 255/25%) 30%, transparent 0 70%, rgb(255 255 255/75%) 0) 50%/100% 8%;
254
+ background-repeat: no-repeat;
255
+ animation: l23 1s infinite steps(12);
256
+ z-index: 7;
257
+
258
+ &::before,
259
+ &::after {
260
+ content: '';
261
+ grid-area: 1/1;
262
+ border-radius: 50%;
263
+ background: inherit;
264
+ opacity: 0.915;
265
+ transform: rotate(30deg);
266
+ }
267
+
268
+ &::after {
269
+ opacity: 0.83;
270
+ transform: rotate(60deg);
271
+ }
272
+ }
273
+
274
+ @keyframes l23 {
275
+ 100% {
276
+ transform: rotate(1turn);
277
+ }
278
+ }
279
+
220
280
  @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
221
281
  --account_btnPadTB: var(--sp2x);
222
282
  --account_btnPadLR: var(--sp7x);
@@ -1,2 +1,5 @@
1
1
  export default Loader;
2
- declare function Loader(): import("react").JSX.Element;
2
+ declare function Loader({ className }: {
3
+ className: any;
4
+ }): React.JSX.Element;
5
+ import React from 'react';
@@ -1,7 +1,23 @@
1
+ 'use client';
2
+ import React, { useState, useEffect } from 'react';
1
3
  //* Styles
2
4
  import LoaderStyle from './style';
3
- //* Component
4
- const Loader = () => {
5
- return React.createElement(LoaderStyle, null);
5
+ const Loader = ({ className }) => {
6
+ //! State
7
+ const [loaderState, setLoaderState] = useState('');
8
+ useEffect(() => {
9
+ setTimeout(() => {
10
+ setLoaderState('start');
11
+ }, 100);
12
+ setTimeout(() => {
13
+ setLoaderState('end');
14
+ }, 2000);
15
+ }, []);
16
+ return (React.createElement(LoaderStyle, { className: `${loaderState || ''}` },
17
+ React.createElement("div", { className: `loader ${className || ''}` },
18
+ React.createElement("div", { className: 'cont' },
19
+ React.createElement("span", { className: 'line-top' }),
20
+ React.createElement("div", { className: 'circle' }),
21
+ React.createElement("span", { className: 'line-bottom' })))));
6
22
  };
7
23
  export default Loader;
@@ -1,3 +1,154 @@
1
1
  import styled from 'styled-components';
2
- const LoaderStyle = styled.div ``;
2
+ const LoaderStyle = styled.div `
3
+ --sizeCircle: calc(var(--sp12x) + var(--sp0-5x));
4
+ --sizeLine: var(--sp2-5x);
5
+
6
+ &:before {
7
+ content: '';
8
+ position: absolute;
9
+ top: 0;
10
+ left: 0;
11
+ width: 100%;
12
+ height: 100%;
13
+ background-color: var(--account_backgroundColor);
14
+ z-index: 1;
15
+ transition: 1s linear;
16
+ }
17
+
18
+ .loader {
19
+ position: absolute;
20
+ top: 0;
21
+ left: 0;
22
+ bottom: 0;
23
+ right: 0;
24
+ width: 100%;
25
+ height: 100vh;
26
+ z-index: 10;
27
+ pointer-events: none;
28
+
29
+ &:before {
30
+ background-color: var(--account_backgroundColor);
31
+ }
32
+
33
+ &:before {
34
+ content: '';
35
+ position: absolute;
36
+ top: 0;
37
+ left: 0;
38
+ width: 100%;
39
+ height: 100%;
40
+ transition: 1s linear 1.8s;
41
+ }
42
+
43
+ .cont {
44
+ position: absolute;
45
+ top: 50%;
46
+ left: 50%;
47
+ transform: translate(-50%, -50%);
48
+ width: var(--sizeCircle);
49
+ height: var(--sizeCircle);
50
+ transition: 0.5s linear 1.5s;
51
+
52
+ span {
53
+ background-color: var(--account_primaryColor1);
54
+ height: var(--sizeLine);
55
+ width: 0;
56
+ position: absolute;
57
+ transition: 0.5s ease-out 1s;
58
+
59
+ &.line-top {
60
+ bottom: calc(100% + var(--sizeLine));
61
+ left: 0;
62
+ }
63
+
64
+ &.line-bottom {
65
+ top: calc(100% + var(--sizeLine));
66
+ right: 0;
67
+ }
68
+ }
69
+
70
+ .circle {
71
+ border-radius: 100%;
72
+ overflow: hidden;
73
+ width: 100%;
74
+ height: 100%;
75
+ position: relative;
76
+ background-color: var(--account_primaryColor5);
77
+
78
+ &:before {
79
+ content: '';
80
+ position: absolute;
81
+ top: 100%;
82
+ left: 0;
83
+ width: 100%;
84
+ height: 100%;
85
+ background: linear-gradient(45deg, rgba(167, 0, 222, 1) 0%, rgba(254, 0, 133, 1) 100%);
86
+ transition: 0.5s ease-in-out;
87
+ }
88
+ }
89
+ }
90
+ }
91
+
92
+ &.start {
93
+ &:before {
94
+ opacity: 0;
95
+ }
96
+
97
+ .loader {
98
+ &:before {
99
+ opacity: 0;
100
+ }
101
+
102
+ .cont {
103
+ transform: translate(-50%, -50%) scale(0);
104
+
105
+ span {
106
+ width: 100%;
107
+ }
108
+
109
+ .circle {
110
+ &:before {
111
+ top: 0;
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+ &.end {
119
+ &:before,
120
+ .loader {
121
+ opacity: 0;
122
+ visibility: hidden;
123
+ }
124
+ }
125
+
126
+ .loader {
127
+ &.account {
128
+ top: calc(-1 * var(--headerFixedHeight) - var(--headerBannerHeight) - var(--account_accountPadT) - var(--account_stickyMarTop));
129
+ }
130
+ }
131
+
132
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
133
+ --sizeCircle: calc(var(--sp6x) + var(--sp0-5x));
134
+ --sizeLine: calc(var(--sp1x) + var(--sp0-5x) / 2);
135
+
136
+ .loader {
137
+ &.account {
138
+ top: 0;
139
+ }
140
+ }
141
+ }
142
+
143
+ @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
144
+ --sizeCircle: calc(var(--sp6x) + var(--sp0-5x));
145
+ --sizeLine: calc(var(--sp1x) + var(--sp0-5x) / 2);
146
+
147
+ .loader {
148
+ &.account {
149
+ top: 0;
150
+ }
151
+ }
152
+ }
153
+ `;
3
154
  export default LoaderStyle;
@@ -0,0 +1,10 @@
1
+ export default BalanceComp;
2
+ declare function BalanceComp({ isBalance, currency, balance, useBalance, balanceHandler, getItemCount }: {
3
+ isBalance?: boolean;
4
+ currency: any;
5
+ balance: any;
6
+ useBalance: any;
7
+ balanceHandler: any;
8
+ getItemCount: any;
9
+ }): React.JSX.Element;
10
+ import React from 'react';
@@ -4,8 +4,8 @@ import { FormBuilder } from '@weareconceptstudio/form';
4
4
  import AccountButton from '../../AccountButton';
5
5
  import { balanceFields } from './utils';
6
6
  //* Style
7
- import MuramoneyCompStyle from './style';
8
- const MuramoneyComp = ({ isMuramoney = true, currency, balance, useBalance, balanceHandler, getItemCount }) => {
7
+ import BalanceCompStyle from './style';
8
+ const BalanceComp = ({ isBalance = true, currency, balance, useBalance, balanceHandler, getItemCount }) => {
9
9
  const { translate } = useTranslation();
10
10
  //! States
11
11
  const [disable, setDisable] = useState(false);
@@ -14,7 +14,7 @@ const MuramoneyComp = ({ isMuramoney = true, currency, balance, useBalance, bala
14
14
  setDisable(true);
15
15
  balanceHandler(values.balance);
16
16
  };
17
- return isMuramoney ? (React.createElement(MuramoneyCompStyle, { className: `collapse-distance ${getItemCount && balance ? ' ' : 'disable'}` },
17
+ return isBalance ? (React.createElement(BalanceCompStyle, { className: `collapse-distance ${getItemCount && balance ? ' ' : 'disable'}` },
18
18
  React.createElement(CollapseItem, { disable: disable,
19
19
  // status={'open'}
20
20
  title: React.createElement(React.Fragment, null,
@@ -22,14 +22,14 @@ const MuramoneyComp = ({ isMuramoney = true, currency, balance, useBalance, bala
22
22
  React.createElement("svg", { width: '12', height: '12', fill: 'none', viewBox: '0 0 12 12', xmlns: 'http://www.w3.org/2000/svg' },
23
23
  React.createElement("path", { d: 'M0 6H12', stroke: 'black', strokeWidth: '2' }),
24
24
  React.createElement("path", { d: 'M6 12L6 0', stroke: 'black', strokeWidth: '2' }))),
25
- React.createElement(Text, { className: 'account-p account-p4 account-primary-color1 account-font-medium muramoney-text' }, `${translate('useYourMoney')} (${handlePriceCheckFunc(balance, currency)} ${translate('balanceLowercase')})`)), description: React.createElement(React.Fragment, null, useBalance ? (React.createElement("div", { className: `muramoney-success-block` },
26
- React.createElement(Text, { className: 'account-p account-p4 account-primary-color2 account-font-medium muramoney-success-text' }, handlePriceCheckFunc(useBalance, currency)),
27
- React.createElement(Text, { text: 'remove', className: 'account-p account-p4 account-primary-color2 account-font-medium muramoney-remove-text', onClick: () => {
25
+ React.createElement(Text, { className: 'account-p account-p4 account-primary-color1 account-font-medium balance-text' }, `${translate('useYourMoney')} (${handlePriceCheckFunc(balance, currency)} ${translate('balanceLowercase')})`)), description: React.createElement(React.Fragment, null, useBalance ? (React.createElement("div", { className: `balance-success-block` },
26
+ React.createElement(Text, { className: 'account-p account-p4 account-primary-color2 account-font-medium balance-success-text' }, handlePriceCheckFunc(useBalance, currency)),
27
+ React.createElement(Text, { text: 'remove', className: 'account-p account-p4 account-primary-color2 account-font-medium balance-remove-text', onClick: () => {
28
28
  balanceHandler(null);
29
29
  setDisable(false);
30
- } }))) : (React.createElement(FormBuilder, { onSubmit: onFinish, fields: balanceFields, className: `muramoney-block`, formOptions: {
31
- className: 'muramoney-container',
30
+ } }))) : (React.createElement(FormBuilder, { onSubmit: onFinish, fields: balanceFields, className: `balance-block`, formOptions: {
31
+ className: 'balance-container',
32
32
  } },
33
- React.createElement(AccountButton, { text: `add`, type: 'submit', btnType: `muramoney-version` })))) }))) : null;
33
+ React.createElement(AccountButton, { text: `add`, type: 'submit', btnType: `balance-version` })))) }))) : null;
34
34
  };
35
- export default MuramoneyComp;
35
+ export default BalanceComp;
@@ -1,2 +1,2 @@
1
- export default PaymentCompStyle;
2
- declare const PaymentCompStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
1
+ export default BalanceCompStyle;
2
+ declare const BalanceCompStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
@@ -1,51 +1,51 @@
1
1
  import styled from 'styled-components';
2
- const MuramoneyCompStyle = styled.div `
3
- --account_muramoneyCompDistance: var(--sp5x);
2
+ const BalanceCompStyle = styled.div `
3
+ --account_balanceCompDistance: var(--sp5x);
4
4
 
5
- --account_muramoneyInputPadTB: var(--sp2x);
6
- --account_muramoneyInputPadLR: var(--sp2x);
7
- --account_muramoneyContainerGap: var(--sp2x);
5
+ --account_balanceInputPadTB: var(--sp2x);
6
+ --account_balanceInputPadLR: var(--sp2x);
7
+ --account_balanceContainerGap: var(--sp2x);
8
8
 
9
9
  border-top: 1px solid rgba(0, 0, 0, 0.4);
10
10
 
11
- .muramoney-container {
11
+ .balance-container {
12
12
  display: flex;
13
13
  justify-content: space-between;
14
- gap: var(--account_muramoneyContainerGap);
14
+ gap: var(--account_balanceContainerGap);
15
15
  }
16
16
 
17
- .muramoney-version {
17
+ .balance-version {
18
18
  width: fit-content !important;
19
19
  height: fit-content !important;
20
20
  margin-top: unset !important;
21
21
  }
22
22
 
23
- .muramoney-block {
23
+ .balance-block {
24
24
  flex: 1;
25
25
 
26
26
  .base-input {
27
- padding: var(--account_muramoneyInputPadTB) var(--account_muramoneyInputPadLR) !important;
27
+ padding: var(--account_balanceInputPadTB) var(--account_balanceInputPadLR) !important;
28
28
  border: 2px solid var(--account_primaryColor2) !important;
29
29
  }
30
30
  }
31
31
 
32
- .muramoney-text {
32
+ .balance-text {
33
33
  width: fit-content;
34
34
  transition: color var(--account_trTime) ease-out;
35
35
  cursor: pointer;
36
36
  }
37
37
 
38
- .muramoney-success-block {
38
+ .balance-success-block {
39
39
  display: flex;
40
- gap: var(--account_muramoneyContainerGap);
40
+ gap: var(--account_balanceContainerGap);
41
41
  justify-content: space-between;
42
- padding: var(--account_muramoneyInputPadTB) var(--account_muramoneyInputPadLR);
42
+ padding: var(--account_balanceInputPadTB) var(--account_balanceInputPadLR);
43
43
  border-radius: var(--sp1x);
44
44
  border: 2px solid var(--account_surfaceColor);
45
45
  background-color: var(--account_surfaceColor);
46
46
  }
47
47
 
48
- .muramoney-remove-text {
48
+ .balance-remove-text {
49
49
  text-decoration-line: underline;
50
50
  text-decoration-style: solid;
51
51
  text-decoration-skip-ink: none;
@@ -67,51 +67,51 @@ const MuramoneyCompStyle = styled.div `
67
67
 
68
68
  /* //! 1920 */
69
69
  @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
70
- --account_muramoneyCompDistance: var(--sp3-5x);
70
+ --account_balanceCompDistance: var(--sp3-5x);
71
71
 
72
- --account_muramoneyContainerGap: var(--sp2x);
72
+ --account_balanceContainerGap: var(--sp2x);
73
73
  }
74
74
 
75
75
  /* //! 1510 */
76
76
  @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
77
- --account_muramoneyCompDistance: var(--sp4x);
77
+ --account_balanceCompDistance: var(--sp4x);
78
78
 
79
- --account_muramoneyContainerGap: var(--sp2x);
79
+ --account_balanceContainerGap: var(--sp2x);
80
80
  }
81
81
 
82
82
  /* //! 1440 */
83
83
  @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
84
- --account_muramoneyCompDistance: var(--sp3x);
84
+ --account_balanceCompDistance: var(--sp3x);
85
85
 
86
- --account_muramoneyContainerGap: var(--sp2x);
86
+ --account_balanceContainerGap: var(--sp2x);
87
87
  }
88
88
 
89
89
  /* //! 1280 */
90
90
  @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
91
- --account_muramoneyCompDistance: var(--sp3x);
91
+ --account_balanceCompDistance: var(--sp3x);
92
92
 
93
- --account_muramoneyContainerGap: var(--sp1x);
93
+ --account_balanceContainerGap: var(--sp1x);
94
94
  }
95
95
 
96
96
  /* //! 1024 */
97
97
  @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
98
- --account_muramoneyCompDistance: var(--sp3x);
98
+ --account_balanceCompDistance: var(--sp3x);
99
99
 
100
- --account_muramoneyContainerGap: var(--sp1x);
100
+ --account_balanceContainerGap: var(--sp1x);
101
101
  }
102
102
 
103
103
  /* //! 768 */
104
104
  @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
105
- --account_muramoneyCompDistance: var(--sp3x);
105
+ --account_balanceCompDistance: var(--sp3x);
106
106
 
107
- --account_muramoneyContainerGap: var(--sp1x);
107
+ --account_balanceContainerGap: var(--sp1x);
108
108
  }
109
109
 
110
110
  /* //! Mobile */
111
111
  @media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
112
- --account_muramoneyCompDistance: var(--sp3x);
112
+ --account_balanceCompDistance: var(--sp3x);
113
113
 
114
- --account_muramoneyContainerGap: var(--sp1x);
114
+ --account_balanceContainerGap: var(--sp1x);
115
115
  }
116
116
  `;
117
- export default MuramoneyCompStyle;
117
+ export default BalanceCompStyle;
@@ -5,7 +5,7 @@ import { useAddressContext, useCheckoutContext } from '../../modules';
5
5
  import AccountButton from '../AccountButton';
6
6
  import FreeShippingComp from './FreeShippingComp';
7
7
  import PromoCodeComp from './PromoCodeComp';
8
- import MuramoneyComp from './MuramoneyComp';
8
+ import BalanceComp from './BalanceComp';
9
9
  import CommentComp from './CommentComp';
10
10
  //* Style
11
11
  import TotalCheckoutStyle from './style';
@@ -30,11 +30,11 @@ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, i
30
30
  event.preventDefault();
31
31
  }
32
32
  };
33
- if ((!itemsCount || !user.balance) && innerCollapseRef.current) {
33
+ if ((!itemsCount || !user?.balance) && innerCollapseRef.current) {
34
34
  let inputField = innerCollapseRef.current.querySelectorAll('.base-input');
35
35
  if (inputField.length) {
36
36
  [...inputField].forEach((item, i) => {
37
- if (!user.balance && itemsCount && i == 1) {
37
+ if (!user?.balance && itemsCount && i == 1) {
38
38
  return;
39
39
  }
40
40
  else {
@@ -44,7 +44,7 @@ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, i
44
44
  }
45
45
  }
46
46
  return () => {
47
- if ((!itemsCount || !user.balance) && innerCollapseRef.current) {
47
+ if ((!itemsCount || !user?.balance) && innerCollapseRef.current) {
48
48
  const inputField = innerCollapseRef.current.querySelectorAll('.base-input');
49
49
  [...inputField].map((item) => {
50
50
  item.removeEventListener('keydown', handleKeyDown);
@@ -71,11 +71,11 @@ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps, i
71
71
  React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-total`, text: `total` }),
72
72
  React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-currency2`, text: itemsCount ? handlePriceCheckFunc(total, currency) : `0 ${currency}` })),
73
73
  !isCheckout ? (React.createElement(FreeShippingComp, { currency: currency, shippingCost: shippingCost, shippingCostValue: shippingCostValue, freeShippingRange: freeShippingRange })) : null,
74
- user ? (React.createElement(CollapseContainer, { className: 'collapse-container-wrapper' },
74
+ React.createElement(CollapseContainer, { className: 'collapse-container-wrapper' },
75
75
  React.createElement("div", { ref: innerCollapseRef },
76
- React.createElement(MuramoneyComp, { getItemCount: itemsCount, balance: user.balance, currency: currency, balanceHandler: handleBalance, useBalance: useBalance }),
77
- React.createElement(PromoCodeComp, { getItemCount: itemsCount, promo_code: promo_code })))) : null,
76
+ React.createElement(BalanceComp, { getItemCount: itemsCount, balance: user?.balance || 0, currency: currency, balanceHandler: handleBalance, useBalance: useBalance }),
77
+ React.createElement(PromoCodeComp, { getItemCount: itemsCount, promo_code: promo_code }))),
78
78
  isCheckout && typeof isShipping === 'boolean' && !isShipping ? React.createElement(CommentComp, { fillCheckoutData: fillCheckoutData }) : null,
79
- React.createElement(AccountButton, { url: buttonProps.url, btnType: `full-width`, text: buttonProps.text, type: buttonProps.type, className: `sticky-wrap-btn`, disabled: buttonProps.disabled, onClick: () => buttonProps.handleClick && buttonProps.handleClick() }))) : (React.createElement(SkeletonTotalCheckout, null))))));
79
+ React.createElement(AccountButton, { loading: buttonProps.loadingButton, url: buttonProps.url, btnType: `full-width`, text: buttonProps.text, type: buttonProps.type, className: `sticky-wrap-btn`, disabled: buttonProps.disabled, onClick: () => buttonProps.handleClick && buttonProps.handleClick() }))) : (React.createElement(SkeletonTotalCheckout, null))))));
80
80
  });
81
81
  export default TotalCheckout;
@@ -72,7 +72,7 @@ const TotalCheckoutStyle = styled.section `
72
72
  }
73
73
 
74
74
  .promo-code-text,
75
- .muramoney-text,
75
+ .balance-text,
76
76
  .comment-text {
77
77
  font-size: var(--account_textSize) !important;
78
78
  line-height: var(--account_lineHeight) !important;
@@ -151,7 +151,7 @@ const TotalCheckoutStyle = styled.section `
151
151
  @media (pointer: fine) {
152
152
  @media (hover: hover) {
153
153
  &:hover {
154
- .muramoney-text,
154
+ .balance-text,
155
155
  .promo-code-text,
156
156
  .comment-text {
157
157
  color: var(--account_primaryColor3);
@@ -184,8 +184,8 @@ const TotalCheckoutStyle = styled.section `
184
184
  }
185
185
  }
186
186
 
187
- .muramoney-container,
188
- .muramoney-success-block,
187
+ .balance-container,
188
+ .balance-success-block,
189
189
  .promo-code-container,
190
190
  .promo-code-success-block {
191
191
  margin-top: var(--account_commentMarginTop);
@@ -2,6 +2,7 @@ import React, { useMemo } from 'react';
2
2
  import { Text, Link, useUi, Page } from '@weareconceptstudio/core';
3
3
  import AccountStyle from './style';
4
4
  import { useAccountContext } from '../../../AccountProvider';
5
+ import Loader from '../../../components/Loader';
5
6
  const AccountTemplate = ({ isFullWidth = true, menuOptions = [], children }) => {
6
7
  const { winWidth } = useUi();
7
8
  const { useUser } = useAccountContext();
@@ -29,6 +30,7 @@ const AccountTemplate = ({ isFullWidth = true, menuOptions = [], children }) =>
29
30
  React.createElement(Text, { text: 'signOut', onClick: signOut, className: 'account-p account-p1 account-error-color account-font-bold sign-out' }))),
30
31
  lineStore,
31
32
  React.createElement("div", { className: `right-bar` },
33
+ React.createElement(Loader, { className: 'account' }),
32
34
  React.createElement("div", { className: `max-width-wrap ${isFullWidth ? 'full-max-width' : ''}` }, children)))))) : null;
33
35
  };
34
36
  export default AccountTemplate;