@weareconceptstudio/account 0.4.6 → 0.4.7
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/dist/components/AccountButton/icons.d.ts +2 -0
- package/dist/components/AccountButton/icons.js +3 -0
- package/dist/components/AccountButton/index.js +8 -4
- package/dist/components/AccountButton/style.js +68 -0
- package/dist/components/TotalCheckout/BalanceComp/index.js +1 -1
- package/dist/components/TotalCheckout/BalanceComp/utils.js +0 -2
- package/dist/components/TotalCheckout/PromoCodeComp/index.d.ts +3 -3
- package/dist/components/TotalCheckout/PromoCodeComp/index.js +5 -5
- package/dist/components/TotalCheckout/index.js +6 -6
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/index.d.ts +2 -1
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/index.js +4 -4
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/style.js +4 -0
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/index.d.ts +2 -1
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/index.js +7 -7
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/ItemStatus/index.d.ts +2 -1
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/ItemStatus/index.js +2 -2
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/index.d.ts +2 -1
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/index.js +2 -2
- package/dist/modules/account/AccountBalanceTemplate/index.js +4 -2
- package/dist/modules/account/AccountSettingsTemplate/AccountInfo/index.js +5 -2
- package/dist/modules/account/AccountSettingsTemplate/AccountInfo/utils.js +5 -5
- package/dist/modules/account/AccountSettingsTemplate/AccountPassword/index.js +2 -2
- package/dist/modules/address/AddressWrap/index.js +3 -2
- package/dist/modules/auth/ForgotPasswordTemplate/index.js +7 -39
- package/dist/modules/auth/ResetPasswordTemplate/ExpiredLink/index.js +2 -2
- package/dist/modules/auth/ResetPasswordTemplate/index.js +6 -6
- package/dist/modules/auth/SignInTemplate/index.d.ts +2 -1
- package/dist/modules/auth/SignInTemplate/index.js +15 -6
- package/dist/modules/auth/SignInTemplate/style.js +28 -0
- package/dist/modules/auth/SignUpTemplate/index.d.ts +2 -1
- package/dist/modules/auth/SignUpTemplate/index.js +6 -2
- package/dist/modules/auth/SignUpTemplate/style.js +28 -0
- package/dist/modules/auth/SignUpTemplate/utils.js +1 -1
- package/dist/modules/auth/VerifyEmailAddressTemplate/index.js +2 -0
- package/dist/modules/cart/SimpleItems/ItemMobile/index.js +8 -3
- package/dist/modules/order/OrderedItems/index.js +5 -2
- package/dist/modules/payment/AddNewCard/index.js +7 -4
- package/dist/translations/en.d.ts +214 -236
- package/dist/translations/en.js +214 -245
- package/dist/translations/hy.d.ts +24 -24
- package/dist/translations/hy.js +40 -57
- package/dist/translations/index.d.ts +262 -284
- package/dist/translations/ru.d.ts +24 -24
- package/dist/translations/ru.js +40 -57
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export const googleIcon = (React.createElement("svg", { fill: 'none', viewBox: '0 0 28 28', xmlns: 'http://www.w3.org/2000/svg' },
|
|
3
|
+
React.createElement("path", { d: 'M27.5725 11.8425L27.4312 11.2431H14.4037V16.7569H22.1875C21.3794 20.5944 17.6294 22.6144 14.5662 22.6144C12.3375 22.6144 9.98812 21.6769 8.43312 20.17C7.61271 19.3623 6.95966 18.4006 6.51137 17.3402C6.06308 16.2797 5.82835 15.1413 5.82062 13.99C5.82062 11.6675 6.86438 9.34437 8.38313 7.81625C9.90188 6.28813 12.1956 5.43313 14.4762 5.43313C17.0881 5.43313 18.96 6.82 19.66 7.4525L23.5781 3.555C22.4287 2.545 19.2712 0 14.35 0C10.5531 0 6.9125 1.45438 4.25125 4.10687C1.625 6.71875 0.265625 10.4956 0.265625 14C0.265625 17.5044 1.55188 21.0925 4.09688 23.725C6.81625 26.5325 10.6675 28 14.6331 28C18.2413 28 21.6612 26.5863 24.0987 24.0212C26.495 21.4963 27.7344 18.0025 27.7344 14.34C27.7344 12.7981 27.5794 11.8825 27.5725 11.8425Z', fill: 'var(--account_primaryColor1)' })));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { Link, useTranslation } from '@weareconceptstudio/core';
|
|
4
|
+
import { googleIcon } from './icons';
|
|
4
5
|
import AccountButtonStyle from './style';
|
|
5
6
|
const AccountButton = (props) => {
|
|
6
|
-
const { btnType, text, className, onClick, children, url, customLinkProps, target, type = 'button', disabled = false, svg_icon, loading = false } = props;
|
|
7
|
+
const { btnType, text, className, onClick, children, url, customLinkProps, target, type = 'button', disabled = false, svg_icon, loading = false, isGoogleAuth = false } = props;
|
|
7
8
|
const { translate } = useTranslation();
|
|
8
9
|
const Component = useMemo(() => (url ? Link : 'button'), [url]);
|
|
9
10
|
const customProps = useMemo(() => (url ? { ...customLinkProps, url, target } : { type, disabled }), [url, type, disabled]);
|
|
@@ -12,14 +13,17 @@ const AccountButton = (props) => {
|
|
|
12
13
|
[className]: className,
|
|
13
14
|
'loading': loading,
|
|
14
15
|
'disabled': disabled,
|
|
16
|
+
'account-google-btn': isGoogleAuth,
|
|
15
17
|
});
|
|
16
18
|
const handleClick = useCallback(() => {
|
|
17
19
|
return !disabled && onClick?.();
|
|
18
20
|
}, [onClick, disabled]);
|
|
19
|
-
return (React.createElement(AccountButtonStyle, { onClick: handleClick, className: `${classString}
|
|
21
|
+
return (React.createElement(AccountButtonStyle, { onClick: handleClick, className: `${classString}` },
|
|
20
22
|
React.createElement(Component, { ...customProps },
|
|
21
23
|
loading ? (React.createElement("div", { className: 'outside-wrapper-loader' },
|
|
22
24
|
React.createElement("div", { className: 'loader' }))) : null,
|
|
23
|
-
React.createElement("div", { className: `content-button ${loading ? 'loading' : ''}` },
|
|
25
|
+
React.createElement("div", { className: `content-button ${loading ? 'loading' : ''}` }, isGoogleAuth ? (React.createElement("div", { className: `google-content-block` },
|
|
26
|
+
googleIcon,
|
|
27
|
+
React.createElement("span", { className: `google-text` }, "google"))) : (svg_icon || children || translate(text))))));
|
|
24
28
|
};
|
|
25
29
|
export default AccountButton;
|
|
@@ -14,6 +14,10 @@ const AccountButtonStyle = styled.div `
|
|
|
14
14
|
--account_promoCodeVersionPadTB: var(--sp2x);
|
|
15
15
|
--account_promoCodeVersionPadLR: var(--sp7x);
|
|
16
16
|
|
|
17
|
+
/* //! Google Auth */
|
|
18
|
+
--account_googleAuthIconSize: var(--sp4x);
|
|
19
|
+
--account_googleAuthContentGap: var(--sp1x);
|
|
20
|
+
|
|
17
21
|
display: inline-flex;
|
|
18
22
|
|
|
19
23
|
button,
|
|
@@ -242,6 +246,49 @@ const AccountButtonStyle = styled.div `
|
|
|
242
246
|
height: calc(100% - var(--account_btnPadTB) * 2);
|
|
243
247
|
}
|
|
244
248
|
|
|
249
|
+
&.account-google-btn {
|
|
250
|
+
a,
|
|
251
|
+
button {
|
|
252
|
+
background-color: var(--account_backgroundColor);
|
|
253
|
+
|
|
254
|
+
svg {
|
|
255
|
+
width: var(--account_googleAuthIconSize);
|
|
256
|
+
height: var(--account_googleAuthIconSize);
|
|
257
|
+
|
|
258
|
+
path {
|
|
259
|
+
transition: fill var(--account_trTime) ease-out;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.google-content-block {
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
gap: var(--account_googleAuthContentGap);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.google-text {
|
|
270
|
+
color: var(--account_primaryColor1);
|
|
271
|
+
transition: color var(--account_trTime) ease-out;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
@media (pointer: fine) {
|
|
275
|
+
@media (hover: hover) {
|
|
276
|
+
&:hover {
|
|
277
|
+
svg {
|
|
278
|
+
path {
|
|
279
|
+
fill: var(--account_secondaryColor9);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.google-text {
|
|
284
|
+
color: var(--account_secondaryColor9);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
245
292
|
.loader {
|
|
246
293
|
/* width: var(--sp4x); */
|
|
247
294
|
height: 100%;
|
|
@@ -290,6 +337,9 @@ const AccountButtonStyle = styled.div `
|
|
|
290
337
|
/* //! Promo Code Version */
|
|
291
338
|
--account_promoCodeVersionPadTB: var(--sp2x);
|
|
292
339
|
--account_promoCodeVersionPadLR: var(--sp7x);
|
|
340
|
+
|
|
341
|
+
/* //! Google Auth */
|
|
342
|
+
--account_googleAuthIconSize: var(--sp3-5x);
|
|
293
343
|
}
|
|
294
344
|
|
|
295
345
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
|
|
@@ -305,6 +355,9 @@ const AccountButtonStyle = styled.div `
|
|
|
305
355
|
/* //! Promo Code Version */
|
|
306
356
|
--account_promoCodeVersionPadTB: var(--sp2x);
|
|
307
357
|
--account_promoCodeVersionPadLR: var(--sp4x);
|
|
358
|
+
|
|
359
|
+
/* //! Google Auth */
|
|
360
|
+
--account_googleAuthIconSize: var(--sp3x);
|
|
308
361
|
}
|
|
309
362
|
|
|
310
363
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
@@ -320,6 +373,9 @@ const AccountButtonStyle = styled.div `
|
|
|
320
373
|
/* //! Promo Code Version */
|
|
321
374
|
--account_promoCodeVersionPadTB: var(--sp2x);
|
|
322
375
|
--account_promoCodeVersionPadLR: var(--sp4x);
|
|
376
|
+
|
|
377
|
+
/* //! Google Auth */
|
|
378
|
+
--account_googleAuthIconSize: var(--sp3x);
|
|
323
379
|
}
|
|
324
380
|
|
|
325
381
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
@@ -335,6 +391,9 @@ const AccountButtonStyle = styled.div `
|
|
|
335
391
|
/* //! Promo Code Version */
|
|
336
392
|
--account_promoCodeVersionPadTB: var(--sp2x);
|
|
337
393
|
--account_promoCodeVersionPadLR: var(--sp4x);
|
|
394
|
+
|
|
395
|
+
/* //! Google Auth */
|
|
396
|
+
--account_googleAuthIconSize: var(--sp3x);
|
|
338
397
|
}
|
|
339
398
|
|
|
340
399
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
@@ -350,6 +409,9 @@ const AccountButtonStyle = styled.div `
|
|
|
350
409
|
/* //! Promo Code Version */
|
|
351
410
|
--account_promoCodeVersionPadTB: var(--sp2x);
|
|
352
411
|
--account_promoCodeVersionPadLR: var(--sp4x);
|
|
412
|
+
|
|
413
|
+
/* //! Google Auth */
|
|
414
|
+
--account_googleAuthIconSize: var(--sp3x);
|
|
353
415
|
}
|
|
354
416
|
|
|
355
417
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
@@ -365,6 +427,9 @@ const AccountButtonStyle = styled.div `
|
|
|
365
427
|
/* //! Promo Code Version */
|
|
366
428
|
--account_promoCodeVersionPadTB: var(--sp2x);
|
|
367
429
|
--account_promoCodeVersionPadLR: var(--sp4x);
|
|
430
|
+
|
|
431
|
+
/* //! Google Auth */
|
|
432
|
+
--account_googleAuthIconSize: var(--sp3x);
|
|
368
433
|
}
|
|
369
434
|
|
|
370
435
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
@@ -380,6 +445,9 @@ const AccountButtonStyle = styled.div `
|
|
|
380
445
|
/* //! Promo Code Version */
|
|
381
446
|
--account_promoCodeVersionPadTB: var(--sp2x);
|
|
382
447
|
--account_promoCodeVersionPadLR: var(--sp4x);
|
|
448
|
+
|
|
449
|
+
/* //! Google Auth */
|
|
450
|
+
--account_googleAuthIconSize: var(--sp3x);
|
|
383
451
|
}
|
|
384
452
|
`;
|
|
385
453
|
export default AccountButtonStyle;
|
|
@@ -20,7 +20,7 @@ const BalanceComp = ({ isBalance = true, currency, balance, useBalance, balanceH
|
|
|
20
20
|
React.createElement("svg", { width: '12', height: '12', fill: 'none', viewBox: '0 0 12 12', xmlns: 'http://www.w3.org/2000/svg' },
|
|
21
21
|
React.createElement("path", { d: 'M0 6H12', stroke: 'black', strokeWidth: '2' }),
|
|
22
22
|
React.createElement("path", { d: 'M6 12L6 0', stroke: 'black', strokeWidth: '2' }))),
|
|
23
|
-
React.createElement(Text, { className: 'account-p account-p4 account-primary-color1 account-font-medium balance-text' }, `${translate('useYourMoney')} (${handlePriceCheckFunc(balance, currency)} ${translate('
|
|
23
|
+
React.createElement(Text, { className: 'account-p account-p4 account-primary-color1 account-font-medium balance-text' }, `${translate('useYourMoney')} (${handlePriceCheckFunc(balance, currency)} ${translate('balance')})`)), description: React.createElement(React.Fragment, null, useBalance ? (React.createElement("div", { className: `balance-success-block` },
|
|
24
24
|
React.createElement(Text, { className: 'account-p account-p4 account-primary-color2 account-font-medium balance-success-text' }, handlePriceCheckFunc(useBalance, currency)),
|
|
25
25
|
React.createElement(Text, { text: 'remove', className: 'account-p account-p4 account-primary-color2 account-font-medium balance-remove-text', onClick: () => {
|
|
26
26
|
balanceHandler(null);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default PromoCodeComp;
|
|
2
|
-
declare function PromoCodeComp({ isPromoCode,
|
|
2
|
+
declare function PromoCodeComp({ isPromoCode, promotionHandler, usePromotion, getItemCount }: {
|
|
3
3
|
isPromoCode?: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
promotionHandler: any;
|
|
5
|
+
usePromotion: any;
|
|
6
6
|
getItemCount: any;
|
|
7
7
|
}): React.JSX.Element;
|
|
8
8
|
import React from 'react';
|
|
@@ -5,14 +5,14 @@ import AccountButton from '../../AccountButton';
|
|
|
5
5
|
import { promoCodeFields } from './utils';
|
|
6
6
|
//* Style
|
|
7
7
|
import PromoCodeCompStyle from './style';
|
|
8
|
-
const PromoCodeComp = ({ isPromoCode = true,
|
|
8
|
+
const PromoCodeComp = ({ isPromoCode = true, promotionHandler, usePromotion, getItemCount }) => {
|
|
9
9
|
//! States
|
|
10
10
|
const [couponCode, setCouponCode] = useState(false);
|
|
11
11
|
const [disable, setDisable] = useState(false);
|
|
12
12
|
//! On Finish
|
|
13
13
|
const onFinish = (values) => {
|
|
14
14
|
setDisable(true);
|
|
15
|
-
|
|
15
|
+
promotionHandler(values.promo_code);
|
|
16
16
|
};
|
|
17
17
|
return isPromoCode ? (React.createElement(PromoCodeCompStyle, { className: `collapse-distance ${getItemCount ? '' : 'disable'}` },
|
|
18
18
|
React.createElement(CollapseItem, { disable: disable, title: React.createElement(React.Fragment, null,
|
|
@@ -20,10 +20,10 @@ const PromoCodeComp = ({ isPromoCode = true, promoCodeHandler, usePromoCode, get
|
|
|
20
20
|
React.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', width: '12', height: '12', viewBox: '0 0 12 12', fill: 'none' },
|
|
21
21
|
React.createElement("path", { d: 'M0 6H12', stroke: 'black', strokeWidth: '2' }),
|
|
22
22
|
React.createElement("path", { d: 'M6 12L6 0', stroke: 'black', strokeWidth: '2' }))),
|
|
23
|
-
React.createElement(Text, { className: 'account-p account-p4 account-primary-color1 account-font-medium promo-code-text', text: 'gotPromotionCode' })), description: React.createElement(React.Fragment, null,
|
|
24
|
-
React.createElement(Text, { className: 'account-p account-p4 account-primary-color2 account-font-medium promo-code-success-text' },
|
|
23
|
+
React.createElement(Text, { className: 'account-p account-p4 account-primary-color1 account-font-medium promo-code-text', text: 'gotPromotionCode' })), description: React.createElement(React.Fragment, null, usePromotion ? (React.createElement("div", { className: `promo-code-success-block` },
|
|
24
|
+
React.createElement(Text, { className: 'account-p account-p4 account-primary-color2 account-font-medium promo-code-success-text' }, usePromotion),
|
|
25
25
|
React.createElement(Text, { text: 'remove', className: 'account-p account-p4 account-primary-color2 account-font-medium promo-code-remove-text', onClick: () => {
|
|
26
|
-
|
|
26
|
+
promotionHandler(null);
|
|
27
27
|
setDisable(false);
|
|
28
28
|
} }))) : (React.createElement(FormBuilder, { onSubmit: onFinish, fields: promoCodeFields, className: `promo-code-block`, formOptions: {
|
|
29
29
|
className: 'promo-code-container',
|
|
@@ -16,12 +16,12 @@ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps })
|
|
|
16
16
|
const { fillCheckoutData, fillCart, checkoutBtnDisabled, isCheckoutPage } = useCheckoutContext();
|
|
17
17
|
const { addressLoading } = useAddressContext();
|
|
18
18
|
const { user } = useUser();
|
|
19
|
-
const { itemsCount, shippingCost, freeShippingRange, shippingCostValue, total, subtotal, useBalance, loading,
|
|
19
|
+
const { itemsCount, shippingCost, freeShippingRange, shippingCostValue, total, subtotal, useBalance, loading, usePromotion, discount } = useCart();
|
|
20
20
|
const handleBalance = (amount) => {
|
|
21
21
|
fillCart('useBalance', amount);
|
|
22
22
|
};
|
|
23
|
-
const
|
|
24
|
-
fillCart('
|
|
23
|
+
const handlePromotion = (promotion) => {
|
|
24
|
+
fillCart('usePromotion', promotion);
|
|
25
25
|
};
|
|
26
26
|
const innerCollapseRef = useRef(null);
|
|
27
27
|
//! disable keypress on input
|
|
@@ -68,9 +68,9 @@ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps })
|
|
|
68
68
|
user && useBalance ? (React.createElement("div", { className: `od-item-wrap` },
|
|
69
69
|
React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1`, text: `muramoney` }),
|
|
70
70
|
React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 balance-text-block`, text: `-${handlePriceCheckFunc(useBalance, currency)}` }))) : null,
|
|
71
|
-
user &&
|
|
71
|
+
user && discount ? (React.createElement("div", { className: `od-item-wrap` },
|
|
72
72
|
React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1`, text: `discount` }),
|
|
73
|
-
React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 balance-text-block`, text: `-${handlePriceCheckFunc(
|
|
73
|
+
React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 balance-text-block`, text: `-${handlePriceCheckFunc(discount, currency)}` }))) : null,
|
|
74
74
|
React.createElement("div", { className: `od-item-wrap` },
|
|
75
75
|
React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-total`, text: `total` }),
|
|
76
76
|
React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1 sticky-wrap-currency2`, text: itemsCount ? handlePriceCheckFunc(total, currency) : `0 ${currency}` })),
|
|
@@ -78,7 +78,7 @@ const TotalCheckout = memo(({ isShipping, children, confirmation, buttonProps })
|
|
|
78
78
|
React.createElement(CollapseContainer, { className: 'collapse-container-wrapper' },
|
|
79
79
|
React.createElement("div", { ref: innerCollapseRef },
|
|
80
80
|
React.createElement(BalanceComp, { getItemCount: itemsCount, balance: user?.balance || 0, currency: currency, balanceHandler: handleBalance, useBalance: useBalance }),
|
|
81
|
-
React.createElement(PromoCodeComp, { getItemCount: itemsCount,
|
|
81
|
+
React.createElement(PromoCodeComp, { getItemCount: itemsCount, promotionHandler: handlePromotion, usePromotion: usePromotion }))),
|
|
82
82
|
isCheckoutPage && typeof isShipping === 'boolean' && !isShipping ? React.createElement(CommentComp, { fillCheckoutData: fillCheckoutData }) : null,
|
|
83
83
|
React.createElement(AccountButton, { loading: buttonProps.loadingButton, url: buttonProps.url, btnType: `full-width`, text: buttonProps.text, type: buttonProps.type, className: `sticky-wrap-btn`, disabled: checkoutBtnDisabled, onClick: () => buttonProps.handleClick && buttonProps.handleClick() }))) : (React.createElement(SkeletonTotalCheckout, null))))));
|
|
84
84
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export default ProgressBalance;
|
|
2
|
-
declare function ProgressBalance({ progress, balance, nextStatusValue, nextStatusTitle, iconValue }: {
|
|
2
|
+
declare function ProgressBalance({ progress, balance, nextStatusValue, nextStatusTitle, iconValue, currency }: {
|
|
3
3
|
progress: any;
|
|
4
4
|
balance: any;
|
|
5
5
|
nextStatusValue: any;
|
|
6
6
|
nextStatusTitle: any;
|
|
7
7
|
iconValue: any;
|
|
8
|
+
currency: any;
|
|
8
9
|
}): React.JSX.Element;
|
|
9
10
|
import React from 'react';
|
|
@@ -4,14 +4,14 @@ import { handlePriceCheckFunc, Text, useTranslation } from '@weareconceptstudio/
|
|
|
4
4
|
import ProgressComponent from './ProgressComponent';
|
|
5
5
|
//* Styles
|
|
6
6
|
import ProgressBalanceStyle from './style';
|
|
7
|
-
const ProgressBalance = ({ progress, balance, nextStatusValue, nextStatusTitle, iconValue }) => {
|
|
7
|
+
const ProgressBalance = ({ progress, balance, nextStatusValue, nextStatusTitle, iconValue, currency }) => {
|
|
8
8
|
const { translate } = useTranslation();
|
|
9
9
|
return (React.createElement(ProgressBalanceStyle, null,
|
|
10
10
|
React.createElement("div", { className: 'wrapper-progress-inner-info' },
|
|
11
11
|
React.createElement(ProgressComponent, { className: 'circular-progress', percent: progress, animated: true, round: true }),
|
|
12
12
|
balance || balance == 0 ? (React.createElement("div", { className: 'wrapper-progress-text' },
|
|
13
|
-
React.createElement(Text, { className: 'account-primary-color1 account-p account-p4 first-letter balance-title'
|
|
14
|
-
React.createElement(Text, { className: 'account-primary-color1 account-h5 first-letter balance-value' }, typeof balance == 'number' ? handlePriceCheckFunc(balance,
|
|
13
|
+
React.createElement(Text, { className: 'account-primary-color1 account-p account-p4 first-letter balance-title', text: 'balance' }),
|
|
14
|
+
React.createElement(Text, { className: 'account-primary-color1 account-h5 first-letter balance-value' }, typeof balance == 'number' ? handlePriceCheckFunc(balance, currency) : balance))) : null),
|
|
15
15
|
nextStatusValue ? (React.createElement("div", { className: 'wrapper-next-status' },
|
|
16
16
|
React.createElement(Text, { className: 'account-primary-color1 account-p account-p4 text-center next-status-text' },
|
|
17
17
|
translate('balanceNextStatusDescription1'),
|
|
@@ -22,6 +22,6 @@ const ProgressBalance = ({ progress, balance, nextStatusValue, nextStatusTitle,
|
|
|
22
22
|
' ',
|
|
23
23
|
translate('balanceNextStatusDescription2'),
|
|
24
24
|
' ',
|
|
25
|
-
React.createElement(Text, { className: 'account-secondary-color9 account-font-medium next-status-title',
|
|
25
|
+
React.createElement(Text, { tag: 'span', className: 'account-secondary-color9 account-font-medium next-status-title', text: nextStatusTitle })))) : null));
|
|
26
26
|
};
|
|
27
27
|
export default ProgressBalance;
|
|
@@ -31,6 +31,10 @@ const ProgressBalanceStyle = styled.div `
|
|
|
31
31
|
padding: 0 var(--account_next_status_padLR);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
.next-status-title {
|
|
35
|
+
text-transform: capitalize;
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
/* //! 1920 */
|
|
35
39
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
36
40
|
/* --sizeProgress: var(--sp51x); */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default HeroBalance;
|
|
2
|
-
declare function HeroBalance({ iconValue, balance, cashback, progress, totalSpent, nextStatusValue, description, title, nextStatusTitle }: {
|
|
2
|
+
declare function HeroBalance({ iconValue, balance, cashback, progress, totalSpent, nextStatusValue, description, title, nextStatusTitle, currency }: {
|
|
3
3
|
iconValue: any;
|
|
4
4
|
balance: any;
|
|
5
5
|
cashback: any;
|
|
@@ -9,5 +9,6 @@ declare function HeroBalance({ iconValue, balance, cashback, progress, totalSpen
|
|
|
9
9
|
description: any;
|
|
10
10
|
title: any;
|
|
11
11
|
nextStatusTitle: any;
|
|
12
|
+
currency: any;
|
|
12
13
|
}): React.JSX.Element;
|
|
13
14
|
import React from 'react';
|
|
@@ -4,30 +4,30 @@ import { handlePriceCheckFunc, Text, useTranslation } from '@weareconceptstudio/
|
|
|
4
4
|
import HeroBalanceStyle from './style';
|
|
5
5
|
//* Component
|
|
6
6
|
import ProgressBalance from './ProgressBalance';
|
|
7
|
-
const HeroBalance = ({ iconValue, balance, cashback, progress, totalSpent, nextStatusValue, description, title, nextStatusTitle }) => {
|
|
7
|
+
const HeroBalance = ({ iconValue, balance, cashback, progress, totalSpent, nextStatusValue, description, title, nextStatusTitle, currency }) => {
|
|
8
8
|
const { translate } = useTranslation();
|
|
9
9
|
const dataInformation = [cashback, totalSpent, balance];
|
|
10
|
-
const dataInformationTitle = ['balanceCashback', 'balanceTotalSpent', '
|
|
10
|
+
const dataInformationTitle = ['balanceCashback', 'balanceTotalSpent', 'balance'];
|
|
11
11
|
return (React.createElement(HeroBalanceStyle, { className: 'account-hero-balance' },
|
|
12
12
|
React.createElement("div", { className: 'inner-wrapper' },
|
|
13
13
|
React.createElement("div", { className: 'left-bar-account-balance' },
|
|
14
14
|
React.createElement("div", { className: 'inner-wrapper-left-bar' },
|
|
15
15
|
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p3 first-letter status-title', text: 'balanceStatus' }),
|
|
16
|
-
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-h5 first-letter text-title'
|
|
16
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-h5 first-letter text-title', text: title }),
|
|
17
17
|
description && (React.createElement(Text, { className: 'account-primary-color1 account-p account-p2 first-letter description-status' },
|
|
18
|
-
description.description1,
|
|
18
|
+
translate(description.description1),
|
|
19
19
|
" ",
|
|
20
20
|
cashback + '%',
|
|
21
21
|
" ",
|
|
22
|
-
description.description2)),
|
|
22
|
+
translate(description.description2))),
|
|
23
23
|
React.createElement("div", { className: 'wrapper-information-payment' }, dataInformation.map((item, i, arr) => {
|
|
24
24
|
return ((item || item == 0) && (React.createElement(Text, { key: i, className: 'account-primary-color1 account-p account-p3 first-letter account-font-medium info-text' },
|
|
25
25
|
translate(dataInformationTitle[i]),
|
|
26
26
|
":",
|
|
27
27
|
' ',
|
|
28
|
-
React.createElement(Text, { tag: 'span', className: 'account-primary-color1 account-p account-p3 first-letter account-font-regular info-value-text' }, arr[0] == item ? item + '%' : typeof item == 'number' ? handlePriceCheckFunc(item,
|
|
28
|
+
React.createElement(Text, { tag: 'span', className: 'account-primary-color1 account-p account-p3 first-letter account-font-regular info-value-text' }, arr[0] == item ? item + '%' : typeof item == 'number' ? handlePriceCheckFunc(item, currency) : item))));
|
|
29
29
|
})))),
|
|
30
30
|
React.createElement("div", { className: 'empty' }),
|
|
31
|
-
React.createElement(ProgressBalance, {
|
|
31
|
+
React.createElement(ProgressBalance, { balance: balance, progress: progress, currency: currency, iconValue: iconValue, nextStatusValue: nextStatusValue, nextStatusTitle: nextStatusTitle }))));
|
|
32
32
|
};
|
|
33
33
|
export default HeroBalance;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export default ItemStatus;
|
|
2
|
-
declare function ItemStatus({ title, cashback, value, className }: {
|
|
2
|
+
declare function ItemStatus({ title, cashback, value, className, currency }: {
|
|
3
3
|
title: any;
|
|
4
4
|
cashback: any;
|
|
5
5
|
value: any;
|
|
6
6
|
className: any;
|
|
7
|
+
currency: any;
|
|
7
8
|
}): React.JSX.Element;
|
|
8
9
|
import React from 'react';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { handlePriceCheckFunc, Text, useTranslation } from '@weareconceptstudio/core';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
const ItemStatus = ({ title, cashback, value, className }) => {
|
|
3
|
+
const ItemStatus = ({ title, cashback, value, className, currency }) => {
|
|
4
4
|
const { translate } = useTranslation();
|
|
5
5
|
return (React.createElement("div", { className: `wrapper-item-status ${className}` },
|
|
6
6
|
React.createElement("div", { className: 'title' },
|
|
@@ -16,6 +16,6 @@ const ItemStatus = ({ title, cashback, value, className }) => {
|
|
|
16
16
|
React.createElement(Text, { className: 'account-primary-color1 account-p account-p4 first-letter text-progress-value' }, value ? (React.createElement(React.Fragment, null,
|
|
17
17
|
translate('balanceStarting'),
|
|
18
18
|
" ",
|
|
19
|
-
handlePriceCheckFunc(value,
|
|
19
|
+
handlePriceCheckFunc(value, currency))) : (translate('balanceFirstOrderStatus'))))));
|
|
20
20
|
};
|
|
21
21
|
export default ItemStatus;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export default StatusBalance;
|
|
2
|
-
declare function StatusBalance({ allItem, activeStatus }: {
|
|
2
|
+
declare function StatusBalance({ allItem, activeStatus, currency }: {
|
|
3
3
|
allItem: any;
|
|
4
4
|
activeStatus: any;
|
|
5
|
+
currency: any;
|
|
5
6
|
}): React.JSX.Element;
|
|
6
7
|
import React from 'react';
|
|
@@ -4,7 +4,7 @@ import { Text, useResizeObserver, useUi } from '@weareconceptstudio/core';
|
|
|
4
4
|
import StatusBalanceStyle from './style';
|
|
5
5
|
//* Component
|
|
6
6
|
import ItemStatus from './ItemStatus';
|
|
7
|
-
const StatusBalance = ({ allItem, activeStatus }) => {
|
|
7
|
+
const StatusBalance = ({ allItem, activeStatus, currency }) => {
|
|
8
8
|
const { winWidth } = useUi();
|
|
9
9
|
//! Refs
|
|
10
10
|
const wrapperStatusRef = useRef();
|
|
@@ -45,7 +45,7 @@ const StatusBalance = ({ allItem, activeStatus }) => {
|
|
|
45
45
|
React.createElement("div", { ref: wrapperStatusRef, className: 'wrapper-status' }, allItem.length &&
|
|
46
46
|
statusActiveItem.current !== false &&
|
|
47
47
|
allItem.map((item, i, arr) => {
|
|
48
|
-
return (React.createElement(ItemStatus, { className: `${i == 0 ? 'start-item' : i == arr.length - 1 ? 'end-item' : ''} ${i <= statusActiveItem.current ? 'active-status' : ''}
|
|
48
|
+
return (React.createElement(ItemStatus, { key: i, title: item.name, value: item.value, currency: currency, cashback: item.cashback, className: `${i == 0 ? 'start-item' : i == arr.length - 1 ? 'end-item' : ''} ${i <= statusActiveItem.current ? 'active-status' : ''}` }));
|
|
49
49
|
})),
|
|
50
50
|
React.createElement("div", { className: 'wrapper-line-all' }, allItem.length &&
|
|
51
51
|
statusActiveItem.current !== false &&
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { api, useTranslation } from '@weareconceptstudio/core';
|
|
3
|
+
import { useAccountContext } from '../../../AccountProvider';
|
|
3
4
|
//* Style
|
|
4
5
|
import AccountBalanceTemplateStyle from './style';
|
|
5
6
|
//* Component
|
|
@@ -8,6 +9,7 @@ import HistoryBalance from './HistoryBalance';
|
|
|
8
9
|
import StatusBalance from './StatusBalance';
|
|
9
10
|
const AccountBalanceTemplate = ({ iconValue, dataItem, linkEarnPage, className }) => {
|
|
10
11
|
const { selectedLang } = useTranslation();
|
|
12
|
+
const { currency } = useAccountContext();
|
|
11
13
|
//! State
|
|
12
14
|
const [dataBalance, setDataBalance] = useState(false);
|
|
13
15
|
useEffect(() => {
|
|
@@ -16,7 +18,7 @@ const AccountBalanceTemplate = ({ iconValue, dataItem, linkEarnPage, className }
|
|
|
16
18
|
});
|
|
17
19
|
}, []);
|
|
18
20
|
return dataBalance ? (React.createElement(AccountBalanceTemplateStyle, { className: className || '' },
|
|
19
|
-
React.createElement(HeroBalance, {
|
|
21
|
+
React.createElement(HeroBalance, { currency: currency, iconValue: iconValue, nextStatusTitle: 'resident', balance: dataBalance.balance, title: dataBalance.info.status, cashback: dataBalance.cashback, progress: dataBalance.info.timeline, totalSpent: dataBalance.info.spent.current, nextStatusValue: dataBalance.info.spent.next, description: (() => {
|
|
20
22
|
if (dataItem) {
|
|
21
23
|
const { description1, description2 } = dataItem.find((item) => item.name?.toLowerCase() === dataBalance.info.status?.toLowerCase()) || {};
|
|
22
24
|
return { description1, description2 };
|
|
@@ -25,7 +27,7 @@ const AccountBalanceTemplate = ({ iconValue, dataItem, linkEarnPage, className }
|
|
|
25
27
|
return false;
|
|
26
28
|
}
|
|
27
29
|
})() }),
|
|
28
|
-
React.createElement(StatusBalance, { activeStatus: dataBalance.info.status
|
|
30
|
+
React.createElement(StatusBalance, { allItem: dataItem, currency: currency, activeStatus: dataBalance.info.status }),
|
|
29
31
|
React.createElement(HistoryBalance, { linkEarnPage: linkEarnPage }))) : null;
|
|
30
32
|
};
|
|
31
33
|
export default AccountBalanceTemplate;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useState, useCallback } from 'react';
|
|
2
|
-
import { Text, useUi } from '@weareconceptstudio/core';
|
|
2
|
+
import { Text, useTranslation, useUi } from '@weareconceptstudio/core';
|
|
3
3
|
import { FormBuilder } from '@weareconceptstudio/form';
|
|
4
4
|
import { AccountButton, WarningMessageForPopup } from '../../../../components';
|
|
5
5
|
import AccountInfoStyle from './style';
|
|
6
6
|
import { defaultDisplayFields, defaultFormFields } from './utils';
|
|
7
7
|
const AccountInfo = ({ user, onAccountUpdate, displayFields = defaultDisplayFields, formFields = defaultFormFields }) => {
|
|
8
8
|
const { openPopup } = useUi();
|
|
9
|
+
const { translate } = useTranslation();
|
|
9
10
|
//! State
|
|
10
11
|
const [edit, setEdit] = useState(false);
|
|
11
12
|
//! Handle Popup
|
|
@@ -26,7 +27,9 @@ const AccountInfo = ({ user, onAccountUpdate, displayFields = defaultDisplayFiel
|
|
|
26
27
|
React.createElement(Text, { text: `accountInformation`, className: `account-p account-p1 account-font-bold account-primary-color1` }),
|
|
27
28
|
!edit ? (React.createElement(React.Fragment, null,
|
|
28
29
|
React.createElement("div", { className: `info-wrap` }, displayFields.map((displayField, index) => (React.createElement("div", { key: index, className: `info-item-wrap` },
|
|
29
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1
|
|
30
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1` },
|
|
31
|
+
`${translate(displayField.label)}`,
|
|
32
|
+
":"),
|
|
30
33
|
"\u00A0",
|
|
31
34
|
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1`, text: user[displayField.value] || '-' }))))),
|
|
32
35
|
React.createElement(AccountButton, { text: `edit`, btnType: `green-large-text`, onClick: () => setEdit(true) }))) : (React.createElement(React.Fragment, null,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const defaultDisplayFields = [
|
|
2
|
-
{ label: '
|
|
3
|
-
{ label: '
|
|
4
|
-
{ label: '
|
|
5
|
-
{ label: '
|
|
2
|
+
{ label: 'firstName', value: 'first_name' },
|
|
3
|
+
{ label: 'lastName', value: 'last_name' },
|
|
4
|
+
{ label: 'phone', value: 'phone' },
|
|
5
|
+
{ label: 'email', value: 'email' },
|
|
6
6
|
];
|
|
7
7
|
export const defaultFormFields = [
|
|
8
8
|
{
|
|
@@ -28,7 +28,7 @@ export const defaultFormFields = [
|
|
|
28
28
|
{
|
|
29
29
|
fieldType: 'phone',
|
|
30
30
|
labelProps: {
|
|
31
|
-
label: '
|
|
31
|
+
label: 'phone',
|
|
32
32
|
name: 'phone',
|
|
33
33
|
},
|
|
34
34
|
},
|
|
@@ -23,10 +23,10 @@ const AccountPassword = ({ formFields = defaultFormFields, onPasswordUpdate }) =
|
|
|
23
23
|
});
|
|
24
24
|
}, []);
|
|
25
25
|
return (React.createElement(AccountPasswordStyle, { className: `account-password` },
|
|
26
|
-
React.createElement(Text, { className: `account-p account-p1 account-font-bold account-primary-color1`, text: `
|
|
26
|
+
React.createElement(Text, { className: `account-p account-p1 account-font-bold account-primary-color1`, text: `password` }),
|
|
27
27
|
!edit ? (React.createElement(React.Fragment, null,
|
|
28
28
|
React.createElement("div", { className: `info-item-wrap` },
|
|
29
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1`, text: `
|
|
29
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1`, text: `password` }),
|
|
30
30
|
"\u00A0",
|
|
31
31
|
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1`, text: '****************' })),
|
|
32
32
|
React.createElement(AccountButton, { text: `edit`, btnType: `green-large-text`, onClick: () => setEdit(true) }))) : (React.createElement(FormBuilder, { formOptions: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import { useAddressContext } from '../AddressProvider';
|
|
4
|
-
import { Text, useUi } from '@weareconceptstudio/core';
|
|
4
|
+
import { Text, useTranslation, useUi } from '@weareconceptstudio/core';
|
|
5
5
|
import AccountButton from '../../../components/AccountButton';
|
|
6
6
|
import EmptyAddress from '../EmptyAddress';
|
|
7
7
|
import AddressItem from '../AddressItem';
|
|
@@ -9,6 +9,7 @@ import AddressForm from '../AddressForm';
|
|
|
9
9
|
const AddressWrap = ({ title = 'addresses', addNewText = 'addNewAdd', type, className }) => {
|
|
10
10
|
const { openPopup } = useUi();
|
|
11
11
|
const { addresses } = useAddressContext();
|
|
12
|
+
const { translate } = useTranslation();
|
|
12
13
|
const classString = classNames('address-wrap', {
|
|
13
14
|
[className]: className,
|
|
14
15
|
});
|
|
@@ -20,7 +21,7 @@ const AddressWrap = ({ title = 'addresses', addNewText = 'addNewAdd', type, clas
|
|
|
20
21
|
return (React.createElement("div", { className: classString },
|
|
21
22
|
React.createElement("div", { className: `address-title-container` },
|
|
22
23
|
React.createElement(Text, { className: `account-p account-p1 account-font-bold account-primary-color1`, text: title }),
|
|
23
|
-
React.createElement(AccountButton, {
|
|
24
|
+
React.createElement(AccountButton, { btnType: `purple-text`, onClick: handleAddNewAddressPopup, text: `+ ${translate(addNewText)}` })),
|
|
24
25
|
addresses.length > 0 ? (React.createElement("div", { className: `flex-wrapper` }, addresses.map((item, index) => (React.createElement(AddressItem, { key: index, type: type, data: item }))))) : (React.createElement(EmptyAddress, null))));
|
|
25
26
|
};
|
|
26
27
|
export default AddressWrap;
|