@weareconceptstudio/account 0.4.6 → 0.4.8
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/CustomCheckbox/index.js +1 -1
- package/dist/components/Sequence/index.js +12 -12
- package/dist/components/TotalCheckout/BalanceComp/index.js +3 -3
- package/dist/components/TotalCheckout/BalanceComp/utils.js +2 -4
- package/dist/components/TotalCheckout/CommentComp/index.js +1 -1
- package/dist/components/TotalCheckout/FreeShippingComp/index.js +3 -3
- package/dist/components/TotalCheckout/PromoCodeComp/index.d.ts +3 -3
- package/dist/components/TotalCheckout/PromoCodeComp/index.js +7 -7
- package/dist/components/TotalCheckout/PromoCodeComp/utils.js +1 -3
- package/dist/components/TotalCheckout/Skeleton/index.js +0 -1
- package/dist/components/TotalCheckout/index.js +13 -13
- package/dist/components/WarningMessageForPopup/index.js +4 -4
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/index.d.ts +2 -1
- package/dist/modules/account/AccountBalanceTemplate/HeroBalance/ProgressBalance/index.js +9 -9
- 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 +8 -8
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/ItemHistory/index.js +4 -4
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/index.js +3 -3
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/ItemStatus/index.d.ts +2 -1
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/ItemStatus/index.js +6 -6
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/index.d.ts +2 -1
- package/dist/modules/account/AccountBalanceTemplate/StatusBalance/index.js +3 -3
- package/dist/modules/account/AccountBalanceTemplate/index.js +4 -2
- package/dist/modules/account/AccountSettingsTemplate/AccountInfo/index.js +10 -7
- package/dist/modules/account/AccountSettingsTemplate/AccountInfo/utils.js +10 -10
- package/dist/modules/account/AccountSettingsTemplate/AccountPassword/index.js +6 -6
- package/dist/modules/account/AccountSettingsTemplate/AccountPassword/utils.js +4 -4
- package/dist/modules/account/AccountTemplate/index.js +3 -3
- package/dist/modules/address/AddressForm/index.js +3 -3
- package/dist/modules/address/AddressItem/index.js +8 -8
- package/dist/modules/address/AddressWrap/index.js +5 -4
- package/dist/modules/address/AddressesTemplate/index.js +2 -2
- package/dist/modules/address/EmptyAddress/index.js +1 -1
- package/dist/modules/address/SelectAddress/index.js +6 -6
- package/dist/modules/address/SelectAddressPopup/index.js +4 -4
- package/dist/modules/address/ShippingBillingInfo/index.js +6 -3
- package/dist/modules/auth/ForgotPasswordTemplate/index.js +14 -46
- package/dist/modules/auth/ResetPasswordTemplate/ExpiredLink/index.js +4 -4
- package/dist/modules/auth/ResetPasswordTemplate/index.js +8 -10
- package/dist/modules/auth/ResetPasswordTemplate/utils.js +2 -2
- package/dist/modules/auth/SignInTemplate/index.d.ts +2 -1
- package/dist/modules/auth/SignInTemplate/index.js +15 -8
- package/dist/modules/auth/SignInTemplate/style.js +28 -0
- package/dist/modules/auth/SignInTemplate/utils.js +4 -4
- package/dist/modules/auth/SignUpTemplate/index.d.ts +2 -1
- package/dist/modules/auth/SignUpTemplate/index.js +13 -9
- package/dist/modules/auth/SignUpTemplate/style.js +28 -0
- package/dist/modules/auth/SignUpTemplate/utils.js +9 -9
- package/dist/modules/auth/VerifyEmailAddressTemplate/index.js +13 -11
- package/dist/modules/cart/CartTemplate/index.js +5 -5
- package/dist/modules/cart/EmptyCart/index.js +3 -3
- package/dist/modules/cart/SimpleItems/Item/index.js +1 -1
- package/dist/modules/cart/SimpleItems/ItemMobile/index.js +8 -3
- package/dist/modules/cart/SimpleItems/index.js +5 -5
- package/dist/modules/checkout/CheckoutTemplate/StepReview/index.js +2 -2
- package/dist/modules/checkout/CheckoutTemplate/StepShipping/index.js +1 -1
- package/dist/modules/checkout/CheckoutTemplate/index.js +1 -1
- package/dist/modules/checkout/ThankYouTemplate/index.js +5 -5
- package/dist/modules/order/EmptyOrders/index.js +3 -3
- package/dist/modules/order/OrderDetails/index.js +9 -9
- package/dist/modules/order/OrderIndividualTemplate/index.js +1 -1
- package/dist/modules/order/OrderStatus/index.js +1 -1
- package/dist/modules/order/OrderedItems/index.js +17 -14
- package/dist/modules/order/OrdersList/OrderItem/index.js +1 -1
- package/dist/modules/order/OrdersList/index.js +19 -11
- package/dist/modules/payment/AddNewCard/index.js +7 -4
- package/dist/modules/payment/Card/index.js +3 -3
- package/dist/modules/payment/Payment/index.js +1 -1
- package/dist/modules/payment/PaymentMethodItem/index.js +1 -1
- package/dist/modules/payment/PaymentMethodsTemplate/index.js +1 -1
- package/dist/modules/payment/SelectPaymentMethodPopup/index.js +3 -3
- package/dist/translations/en.d.ts +195 -194
- package/dist/translations/en.js +199 -207
- package/dist/translations/hy.d.ts +237 -214
- package/dist/translations/hy.js +237 -231
- package/dist/translations/index.d.ts +642 -595
- package/dist/translations/ru.d.ts +237 -214
- package/dist/translations/ru.js +237 -231
- package/package.json +1 -1
|
@@ -27,15 +27,15 @@ const ItemHistory = ({ date, activity, value, action_type }) => {
|
|
|
27
27
|
React.createElement("div", { className: 'inner-wrapper-info', ref: innerWrapperRef },
|
|
28
28
|
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p1 date-info-text' },
|
|
29
29
|
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p1 mobile-date-info-text first-letter', tag: 'span' },
|
|
30
|
-
translate('balanceCategoryDate'),
|
|
30
|
+
translate('account.balance_promotions.balanceCategoryDate'),
|
|
31
31
|
":"),
|
|
32
|
-
|
|
32
|
+
"\u00A0",
|
|
33
33
|
date),
|
|
34
34
|
React.createElement("div", { className: 'wrapper-activity-text' },
|
|
35
35
|
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p1 activity-info-text' }, activity)),
|
|
36
36
|
React.createElement(Text, { className: `account-primary-color1 account-font-medium account-p account-p1 amount-info-text ${action_type}` },
|
|
37
|
-
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p1 mobile-amount-info-text first-letter', tag: 'span' }, translate('balanceCategoryAmount')),
|
|
38
|
-
|
|
37
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p1 mobile-amount-info-text first-letter', tag: 'span' }, translate('account.balance_promotions.balanceCategoryAmount')),
|
|
38
|
+
"\u00A0",
|
|
39
39
|
value)),
|
|
40
40
|
React.createElement("div", { className: 'line-info' })));
|
|
41
41
|
};
|
|
@@ -5,7 +5,7 @@ import HistoryBalanceStyle from './style';
|
|
|
5
5
|
//* Component
|
|
6
6
|
import ItemHistory from './ItemHistory';
|
|
7
7
|
import { Pagination } from '../../../../components';
|
|
8
|
-
const dataCategoryName = ['balanceCategoryDate', 'balanceCategoryActivity', 'balanceCategoryAmount'];
|
|
8
|
+
const dataCategoryName = ['account.balance_promotions.balanceCategoryDate', 'account.balance_promotions.balanceCategoryActivity', 'account.balance_promotions.balanceCategoryAmount'];
|
|
9
9
|
const HistoryBalance = ({ linkEarnPage }) => {
|
|
10
10
|
const { translate, selectedLang } = useTranslation();
|
|
11
11
|
const [currentPage, setCurrentPage] = useState(1);
|
|
@@ -28,9 +28,9 @@ const HistoryBalance = ({ linkEarnPage }) => {
|
|
|
28
28
|
return data && data.length ? (React.createElement(HistoryBalanceStyle, null,
|
|
29
29
|
React.createElement("div", { className: 'wrapper-title-section-history' },
|
|
30
30
|
React.createElement("div", { className: 'wrapper-history-link' },
|
|
31
|
-
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p1 first-letter title-section-history', text: 'balanceRecentActivity' }),
|
|
31
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p1 first-letter title-section-history', text: 'account.balance_promotions.balanceRecentActivity' }),
|
|
32
32
|
linkEarnPage ? (React.createElement(Link, { href: '/muramoney' },
|
|
33
|
-
React.createElement(Text, { className: 'account-primary-color1 account-font-bold account-p account-p4 first-letter how-earn-text', text: 'balanceHowToEarn' }))) : null),
|
|
33
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-bold account-p account-p4 first-letter how-earn-text', text: 'account.balance_promotions.balanceHowToEarn' }))) : null),
|
|
34
34
|
React.createElement("div", { className: 'line-title' })),
|
|
35
35
|
React.createElement("div", { className: 'wrapper-history-container' },
|
|
36
36
|
React.createElement("div", { className: 'wrapper-history-category-title', id: 'history-category-title' }, dataCategoryName.map((item, i) => {
|
|
@@ -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,21 +1,21 @@
|
|
|
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
|
-
return (React.createElement("div", { className: `wrapper-item-status ${className}` },
|
|
5
|
+
return (React.createElement("div", { className: `wrapper-item-status ${className || ''}` },
|
|
6
6
|
React.createElement("div", { className: 'title' },
|
|
7
|
-
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p3 first-letter title-status-progress' }
|
|
7
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p3 first-letter title-status-progress', text: `account.user_status.${title}` })),
|
|
8
8
|
React.createElement("div", { className: 'circle-line' },
|
|
9
9
|
React.createElement("div", { className: 'circle' })),
|
|
10
10
|
React.createElement("div", { className: 'cashback' },
|
|
11
11
|
React.createElement(Text, { className: 'account-primary-color1 account-p account-p4 first-letter text-progress-cashback' },
|
|
12
12
|
cashback + '%',
|
|
13
13
|
" ",
|
|
14
|
-
translate('balanceCashback'))),
|
|
14
|
+
translate('account.balance_promotions.balanceCashback'))),
|
|
15
15
|
React.createElement("div", { className: 'value' },
|
|
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
|
-
translate('balanceStarting'),
|
|
17
|
+
translate('account.balance_promotions.balanceStarting'),
|
|
18
18
|
" ",
|
|
19
|
-
handlePriceCheckFunc(value,
|
|
19
|
+
handlePriceCheckFunc(value, currency))) : (translate('account.balance_promotions.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();
|
|
@@ -38,14 +38,14 @@ const StatusBalance = ({ allItem, activeStatus }) => {
|
|
|
38
38
|
}, [resizes, winWidth]);
|
|
39
39
|
return (React.createElement(StatusBalanceStyle, { ref: styleRef, className: 'account-progress-status-wrapper' },
|
|
40
40
|
React.createElement("div", { className: 'wrapper-title-section' },
|
|
41
|
-
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p1 first-letter status-title-section-progress', text: 'balanceStatus' }),
|
|
41
|
+
React.createElement(Text, { className: 'account-primary-color1 account-font-medium account-p account-p1 first-letter status-title-section-progress', text: 'account.balance_promotions.balanceStatus' }),
|
|
42
42
|
React.createElement("div", { className: 'line-title' })),
|
|
43
43
|
React.createElement("div", { ref: outsideContentRef, className: 'outside-wrapper-content' },
|
|
44
44
|
React.createElement("div", { ref: contentRef, className: 'content-wrapper' },
|
|
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.toLowerCase(), 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,16 +1,17 @@
|
|
|
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
|
|
12
13
|
const handleSuccessPopup = useCallback(() => {
|
|
13
|
-
openPopup(React.createElement(WarningMessageForPopup, { title: 'yourSettingsHaveBeenSaved', description: '
|
|
14
|
+
openPopup(React.createElement(WarningMessageForPopup, { title: 'account.order_balance.yourSettingsHaveBeenSaved', description: 'account.password_management.yourPasswordHaveBeenChanged' }), {
|
|
14
15
|
className: 'messagePopup',
|
|
15
16
|
accountIcon: true,
|
|
16
17
|
});
|
|
@@ -23,18 +24,20 @@ const AccountInfo = ({ user, onAccountUpdate, displayFields = defaultDisplayFiel
|
|
|
23
24
|
});
|
|
24
25
|
}, [edit]);
|
|
25
26
|
return (user && (React.createElement(AccountInfoStyle, { className: `account-info` },
|
|
26
|
-
React.createElement(Text, { text: `accountInformation`, className: `account-p account-p1 account-font-bold account-primary-color1` }),
|
|
27
|
+
React.createElement(Text, { text: `account.account_info.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
|
-
React.createElement(AccountButton, { text: `edit`, btnType: `green-large-text`, onClick: () => setEdit(true) }))) : (React.createElement(React.Fragment, null,
|
|
35
|
+
React.createElement(AccountButton, { text: `account.general_actions.edit`, btnType: `green-large-text`, onClick: () => setEdit(true) }))) : (React.createElement(React.Fragment, null,
|
|
33
36
|
React.createElement(FormBuilder, { fields: formFields, onSubmit: onFinish, className: 'form-items-wrap', formOptions: {
|
|
34
37
|
initialValues: user,
|
|
35
38
|
} },
|
|
36
39
|
React.createElement("div", { className: `cancel-and-save-and-apply-wrap` },
|
|
37
|
-
React.createElement(AccountButton, {
|
|
38
|
-
React.createElement(AccountButton, { type: 'submit',
|
|
40
|
+
React.createElement(AccountButton, { btnType: `green-large-text`, onClick: () => setEdit(false), text: `account.general_actions.cancel` }),
|
|
41
|
+
React.createElement(AccountButton, { type: 'submit', btnType: `full-width`, text: `account.general_actions.saveChanges` }))))))));
|
|
39
42
|
};
|
|
40
43
|
export default AccountInfo;
|
|
@@ -1,41 +1,41 @@
|
|
|
1
1
|
export const defaultDisplayFields = [
|
|
2
|
-
{ label: '
|
|
3
|
-
{ label: '
|
|
4
|
-
{ label: '
|
|
5
|
-
{ label: '
|
|
2
|
+
{ label: 'account.account_info.firstName', value: 'first_name' },
|
|
3
|
+
{ label: 'account.account_info.lastName', value: 'last_name' },
|
|
4
|
+
{ label: 'account.account_info.phone', value: 'phone' },
|
|
5
|
+
{ label: 'account.account_info.email', value: 'email' },
|
|
6
6
|
];
|
|
7
7
|
export const defaultFormFields = [
|
|
8
8
|
{
|
|
9
9
|
fieldType: 'input',
|
|
10
10
|
labelProps: {
|
|
11
|
-
label: 'firstName',
|
|
11
|
+
label: 'account.account_info.firstName',
|
|
12
12
|
name: 'first_name',
|
|
13
13
|
},
|
|
14
14
|
fieldProps: {
|
|
15
|
-
placeholder: 'firstNamePlaceholder',
|
|
15
|
+
placeholder: 'account.account_info.firstNamePlaceholder',
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
fieldType: 'input',
|
|
20
20
|
labelProps: {
|
|
21
|
-
label: 'lastName',
|
|
21
|
+
label: 'account.account_info.lastName',
|
|
22
22
|
name: 'last_name',
|
|
23
23
|
},
|
|
24
24
|
fieldProps: {
|
|
25
|
-
placeholder: 'lastNamePlaceholder',
|
|
25
|
+
placeholder: 'account.account_info.lastNamePlaceholder',
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
fieldType: 'phone',
|
|
30
30
|
labelProps: {
|
|
31
|
-
label: '
|
|
31
|
+
label: 'account.account_info.phone',
|
|
32
32
|
name: 'phone',
|
|
33
33
|
},
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
fieldType: 'input',
|
|
37
37
|
labelProps: {
|
|
38
|
-
label: 'email',
|
|
38
|
+
label: 'account.account_info.email',
|
|
39
39
|
name: 'email',
|
|
40
40
|
},
|
|
41
41
|
fieldProps: {
|
|
@@ -10,7 +10,7 @@ const AccountPassword = ({ formFields = defaultFormFields, onPasswordUpdate }) =
|
|
|
10
10
|
const [edit, setEdit] = useState(false);
|
|
11
11
|
//! Handle Popup
|
|
12
12
|
const handleSuccessPopup = useCallback(() => {
|
|
13
|
-
openPopup(React.createElement(WarningMessageForPopup, { title: 'yourSettingsHaveBeenSaved', description: 'yourPasswordHaveBeenChanged' }), {
|
|
13
|
+
openPopup(React.createElement(WarningMessageForPopup, { title: 'account.order_balance.yourSettingsHaveBeenSaved', description: 'account.password_management.yourPasswordHaveBeenChanged' }), {
|
|
14
14
|
className: 'messagePopup',
|
|
15
15
|
accountIcon: true,
|
|
16
16
|
});
|
|
@@ -23,17 +23,17 @@ 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: `account.password_management.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: `account.password_management.password` }),
|
|
30
30
|
"\u00A0",
|
|
31
31
|
React.createElement(Text, { className: `account-p account-p3 account-font-regular account-primary-color1`, text: '****************' })),
|
|
32
|
-
React.createElement(AccountButton, { text: `edit`, btnType: `green-large-text`, onClick: () => setEdit(true) }))) : (React.createElement(FormBuilder, { formOptions: {
|
|
32
|
+
React.createElement(AccountButton, { text: `account.general_actions.edit`, btnType: `green-large-text`, onClick: () => setEdit(true) }))) : (React.createElement(FormBuilder, { formOptions: {
|
|
33
33
|
className: 'password-form-wrapper',
|
|
34
34
|
}, className: 'form-items-wrap', onSubmit: onFinish, fields: formFields },
|
|
35
35
|
React.createElement("div", { className: `cancel-and-save-and-apply-wrap` },
|
|
36
|
-
React.createElement(AccountButton, {
|
|
37
|
-
React.createElement(AccountButton, { type: 'submit',
|
|
36
|
+
React.createElement(AccountButton, { btnType: `green-large-text`, onClick: () => setEdit(false), text: `account.general_actions.cancel` }),
|
|
37
|
+
React.createElement(AccountButton, { type: 'submit', btnType: `full-width`, text: `account.general_actions.saveChanges` }))))));
|
|
38
38
|
};
|
|
39
39
|
export default AccountPassword;
|
|
@@ -2,23 +2,23 @@ export const defaultFormFields = [
|
|
|
2
2
|
{
|
|
3
3
|
fieldType: 'password',
|
|
4
4
|
labelProps: {
|
|
5
|
-
label: 'enterCurrentPassword',
|
|
5
|
+
label: 'account.password_management.enterCurrentPassword',
|
|
6
6
|
name: 'current_password',
|
|
7
7
|
rules: [{ type: 'password' }],
|
|
8
8
|
},
|
|
9
9
|
fieldProps: {
|
|
10
|
-
placeholder: 'enterCurrentPasswordPlaceholder',
|
|
10
|
+
placeholder: 'account.password_management.enterCurrentPasswordPlaceholder',
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
fieldType: 'password',
|
|
15
15
|
labelProps: {
|
|
16
|
-
label: 'enterNewPassword',
|
|
16
|
+
label: 'account.password_management.enterNewPassword',
|
|
17
17
|
name: 'password',
|
|
18
18
|
rules: [{ type: 'new-password' }],
|
|
19
19
|
},
|
|
20
20
|
fieldProps: {
|
|
21
|
-
placeholder: 'enterNewPasswordPlaceholder',
|
|
21
|
+
placeholder: 'account.password_management.enterNewPasswordPlaceholder',
|
|
22
22
|
},
|
|
23
23
|
},
|
|
24
24
|
];
|
|
@@ -15,7 +15,7 @@ const AccountTemplate = ({ isFullWidth = true, menuOptions = [], children }) =>
|
|
|
15
15
|
}, [winWidth]);
|
|
16
16
|
//! Menu
|
|
17
17
|
const menu = useMemo(() => {
|
|
18
|
-
return menuOptions.map((menuItem, index) => (React.createElement(Link, { key: index, href: menuItem.url, className: `menu-item ${menuItem.className
|
|
18
|
+
return menuOptions.map((menuItem, index) => (React.createElement(Link, { key: index, href: menuItem.url, className: `menu-item ${menuItem.className || ''}`, ...menuItem.options },
|
|
19
19
|
React.createElement(Text, { tag: `span`, className: `account-p account-p1 account-font-bold sidebar-item`, text: menuItem.name }))));
|
|
20
20
|
}, [menuOptions]);
|
|
21
21
|
const loadingComponent = useMemo(() => {
|
|
@@ -26,10 +26,10 @@ const AccountTemplate = ({ isFullWidth = true, menuOptions = [], children }) =>
|
|
|
26
26
|
React.createElement("aside", { className: 'sidebar' },
|
|
27
27
|
React.createElement("div", { className: `sidebar-inner-wrap` },
|
|
28
28
|
React.createElement("div", { className: `my-acc-wrap` },
|
|
29
|
-
React.createElement(Text, { className: 'account-p account-p1 account-font-bold account-primary-color1', text: 'myAccount' }),
|
|
29
|
+
React.createElement(Text, { className: 'account-p account-p1 account-font-bold account-primary-color1', text: 'account.account_info.myAccount' }),
|
|
30
30
|
React.createElement("div", { className: `account-line` })),
|
|
31
31
|
React.createElement("div", { className: 'tabs-wrap' }, menu),
|
|
32
|
-
React.createElement(Text, {
|
|
32
|
+
React.createElement(Text, { onClick: signOut, text: 'account.auth_account_management.signOut', className: 'account-p account-p1 account-error-color account-font-bold sign-out' }))),
|
|
33
33
|
lineStore,
|
|
34
34
|
React.createElement("div", { className: `right-bar` },
|
|
35
35
|
loadingComponent,
|
|
@@ -40,9 +40,9 @@ const AddressForm = Memo(({ title, data, type }) => {
|
|
|
40
40
|
isChecked ? (React.createElement("div", { className: 'checkbox-wrap', role: 'button' },
|
|
41
41
|
React.createElement(CheckboxCheckedIcon, null))) : (React.createElement("div", { className: 'checkbox-wrap', role: 'button' },
|
|
42
42
|
React.createElement(CheckboxIcon, null))),
|
|
43
|
-
React.createElement(Text, { className: `account-p account-p2 account-font-medium account-primary-color1 address-form-is-default-checkbox`, text: `${type === 'shipping' ? 'makeYourDefaultShippingAddress' : type == 'billing' ? 'makeYourDefaultBillingAddress' : 'makeYourDefaultAddress'}` }))) : (React.createElement(Text, { className: `account-p account-p2 account-font-medium account-primary-color1 address-form-is-default`, text: `${type === 'shipping' ? 'thisYourDefaultShippingAddress' : type == 'billing' ? 'thisYourDefaultBillingAddress' : 'thisYourDefaultAddress'}` }))),
|
|
43
|
+
React.createElement(Text, { className: `account-p account-p2 account-font-medium account-primary-color1 address-form-is-default-checkbox`, text: `${type === 'shipping' ? 'account.address_management.makeYourDefaultShippingAddress' : type == 'billing' ? 'account.address_management.makeYourDefaultBillingAddress' : 'account.address_management.makeYourDefaultAddress'}` }))) : (React.createElement(Text, { className: `account-p account-p2 account-font-medium account-primary-color1 address-form-is-default`, text: `${type === 'shipping' ? 'account.address_management.thisYourDefaultShippingAddress' : type == 'billing' ? 'account.address_management.thisYourDefaultBillingAddress' : 'account.address_management.thisYourDefaultAddress'}` }))),
|
|
44
44
|
React.createElement("div", { className: `cancel-and-save-wrap` },
|
|
45
|
-
React.createElement(AccountButton, {
|
|
46
|
-
React.createElement(AccountButton, { type: 'submit', text: `${isCheckoutPage ? 'saveAndApply' : isEdit ? 'saveChanges' : 'save'}
|
|
45
|
+
React.createElement(AccountButton, { onClick: closePopup, btnType: `green-large-text`, className: `address-form-cancel-btn`, text: `account.general_actions.cancel` }),
|
|
46
|
+
React.createElement(AccountButton, { type: 'submit', disabled: isDisabled, btnType: `full-width`, className: `address-form-cancel-submit`, text: `${isCheckoutPage ? 'account.general_actions.saveAndApply' : isEdit ? 'account.general_actions.saveChanges' : 'account.general_actions.save'}` })))));
|
|
47
47
|
});
|
|
48
48
|
export default AddressForm;
|
|
@@ -13,40 +13,40 @@ const AddressItem = ({ type, title, data, checkout_review, select_address, onCli
|
|
|
13
13
|
const { translate } = useTranslation();
|
|
14
14
|
//! Handle Popups
|
|
15
15
|
const handleDeletePopup = useCallback(() => {
|
|
16
|
-
openPopup(React.createElement(WarningMessageForPopup, { isDelete: true, title: 'deleteAddressMessage', description: 'confirmDeleteAddress', onRemove: () => deleteAddress({ addressId: data.id, type: data.type }) }), {
|
|
16
|
+
openPopup(React.createElement(WarningMessageForPopup, { isDelete: true, title: 'account.address_management.deleteAddressMessage', description: 'account.address_management.confirmDeleteAddress', onRemove: () => deleteAddress({ addressId: data.id, type: data.type }) }), {
|
|
17
17
|
className: 'messagePopup',
|
|
18
18
|
accountIcon: true,
|
|
19
19
|
});
|
|
20
20
|
}, [data]);
|
|
21
21
|
const handleEditAddressPopup = useCallback(() => {
|
|
22
|
-
openPopup(React.createElement(AddressForm, { title: type === 'billing' ? `updateYourBillingAddress` : type == 'shipping' ? `updateYourShippingAddress` : 'updateYourAddress', data: data }), {
|
|
22
|
+
openPopup(React.createElement(AddressForm, { title: type === 'billing' ? `account.address_management.updateYourBillingAddress` : type == 'shipping' ? `account.address_management.updateYourShippingAddress` : 'account.address_management.updateYourAddress', data: data }), {
|
|
23
23
|
accountIcon: true,
|
|
24
24
|
});
|
|
25
25
|
}, [data]);
|
|
26
26
|
return data ? (React.createElement(AddressItemStyle, { className: `item-container ${className || ''}` },
|
|
27
27
|
checkout_review && (React.createElement("div", { className: `change-address-wrap` },
|
|
28
28
|
React.createElement(Text, { text: title, className: `account-p account-p2 account-font-bold account-primary-color1` }),
|
|
29
|
-
React.createElement(AccountButton, {
|
|
29
|
+
React.createElement(AccountButton, { onClick: onClick, btnType: `green-small-text`, text: `account.general_actions.change` }))),
|
|
30
30
|
React.createElement("div", { className: `item-internal-wrap user-select-none` }, isNote && data.note_for_courier ? (React.createElement("div", { className: 'flex-box-block' },
|
|
31
31
|
React.createElement("div", { className: `relative-wrapper box-block` },
|
|
32
32
|
React.createElement("div", { className: `personal-data-wrap` }, data.displayLines.map((line, index) => (React.createElement(Text, { key: index, text: line, className: `account-p account-p3 account-primary-color1 ${index == 0 ? 'account-font-bold' : 'account-font-regular'} ${index == 1 || index == data.displayLines.length - 1 ? 'line-distance' : ''}` })))),
|
|
33
|
-
data.is_default ? (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color3 margin-style is-default`, text: `${type === 'shipping' ? 'defaultShippingAddress' : type == 'billing' ? 'defaultBillingAddress' : 'defaultAddress'}` })) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 margin-style opacity-zero`, text: `empty` }))),
|
|
33
|
+
data.is_default ? (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color3 margin-style is-default`, text: `${type === 'shipping' ? 'account.address_management.defaultShippingAddress' : type == 'billing' ? 'account.address_management.defaultBillingAddress' : 'account.address_management.defaultAddress'}` })) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 margin-style opacity-zero`, text: `empty` }))),
|
|
34
34
|
React.createElement(Text, { className: `account-p account-p3 account-primary-color1 box-block` },
|
|
35
35
|
React.createElement("span", { className: `account-font-bold` },
|
|
36
|
-
translate('note'),
|
|
36
|
+
translate('account.order_balance.note'),
|
|
37
37
|
":"),
|
|
38
38
|
" ",
|
|
39
39
|
React.createElement("span", { className: `account-font-regular` }, data.note_for_courier)))) : (React.createElement(React.Fragment, null,
|
|
40
40
|
React.createElement("div", { className: `relative-wrapper` },
|
|
41
41
|
React.createElement("div", { className: `personal-data-wrap` }, data.displayLines.map((line, index) => (React.createElement(Text, { key: index, className: `account-p account-p3 account-primary-color1 ${index == 0 ? 'account-font-bold' : 'account-font-regular'} ${index == 1 || index == data.displayLines.length - 1 ? 'line-distance' : ''}`, text: line })))),
|
|
42
|
-
data.is_default ? (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color3 margin-style is-default`, text: `${type === 'shipping' ? 'defaultShippingAddress' : type == 'billing' ? 'defaultBillingAddress' : 'defaultAddress'}` })) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 margin-style opacity-zero`, text: `empty` })),
|
|
42
|
+
data.is_default ? (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color3 margin-style is-default`, text: `${type === 'shipping' ? 'account.address_management.defaultShippingAddress' : type == 'billing' ? 'account.address_management.defaultBillingAddress' : 'account.address_management.defaultAddress'}` })) : (React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 margin-style opacity-zero`, text: `empty` })),
|
|
43
43
|
select_address && (React.createElement("div", { className: `circle-selected-wrap cursor-pointer ${checkedId == data.id ? 'active' : ''}`, onClick: () => setCheckedId(data.id) },
|
|
44
44
|
React.createElement("svg", { version: '1.1', viewBox: '0 0 32 32', xmlns: 'http://www.w3.org/2000/svg', className: `checkbox-icon ${selectedAddresses?.id === data.id ? 'selected' : 'note-selected'}` },
|
|
45
45
|
React.createElement("path", { d: 'M13.345 30.462c-1.062 0-1.859-0.531-2.39-1.328l-9.56-16.996c-0.797-1.328-0.266-2.921 1.062-3.718 1.328-0.531 2.921 0 3.718 1.328l7.436 13.012 12.481-20.183c0.797-1.328 2.39-1.593 3.718-0.797s1.593 2.39 0.797 3.718l-14.871 23.635c-0.531 0.797-1.328 1.328-2.39 1.328z' }))))),
|
|
46
46
|
!checkout_review ? (React.createElement("div", { className: `edit-remove-wrapper` },
|
|
47
|
-
React.createElement(AccountButton, { text: `edit`, btnType: `green-small-text`, onClick: handleEditAddressPopup, className: `btn-one-address-version ${!select_address || (select_address && checkedId == data.id) ? 'show' : ''}` }),
|
|
47
|
+
React.createElement(AccountButton, { text: `account.general_actions.edit`, btnType: `green-small-text`, onClick: handleEditAddressPopup, className: `btn-one-address-version ${!select_address || (select_address && checkedId == data.id) ? 'show' : ''}` }),
|
|
48
48
|
!select_address && !data.is_default && (React.createElement(React.Fragment, null,
|
|
49
49
|
React.createElement("div", { className: `vertical-line` }),
|
|
50
|
-
React.createElement(AccountButton, { text: `remove`, onClick: handleDeletePopup, btnType: `green-small-text`, className: `btn-more-address-version` }))))) : null))))) : null;
|
|
50
|
+
React.createElement(AccountButton, { text: `account.general_actions.remove`, onClick: handleDeletePopup, btnType: `green-small-text`, className: `btn-more-address-version` }))))) : null))))) : null;
|
|
51
51
|
};
|
|
52
52
|
export default AddressItem;
|
|
@@ -1,26 +1,27 @@
|
|
|
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';
|
|
8
8
|
import AddressForm from '../AddressForm';
|
|
9
|
-
const AddressWrap = ({ title = 'addresses', addNewText = 'addNewAdd', type, className }) => {
|
|
9
|
+
const AddressWrap = ({ title = 'account.address_management.addresses', addNewText = 'account.order_balance.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
|
});
|
|
15
16
|
const handleAddNewAddressPopup = () => {
|
|
16
|
-
openPopup(React.createElement(AddressForm, { title: 'addNewAddress', type: type }), {
|
|
17
|
+
openPopup(React.createElement(AddressForm, { title: 'account.address_management.addNewAddress', type: type }), {
|
|
17
18
|
accountIcon: true,
|
|
18
19
|
});
|
|
19
20
|
};
|
|
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;
|
|
@@ -5,7 +5,7 @@ import AddressesTemplateStyle from './style';
|
|
|
5
5
|
const AddressesTemplate = () => {
|
|
6
6
|
const { hasAddressType } = useAddressContext();
|
|
7
7
|
return (React.createElement(AddressesTemplateStyle, null, hasAddressType ? (React.createElement(React.Fragment, null,
|
|
8
|
-
React.createElement(AddressWrap, { type: 'shipping', title: 'shippingAddress', addNewText: 'addNewShippingAddress' }),
|
|
9
|
-
React.createElement(AddressWrap, { type: 'billing', title: 'billingAddress', addNewText: 'addNewBillingAddress' }))) : (React.createElement(AddressWrap, null))));
|
|
8
|
+
React.createElement(AddressWrap, { type: 'account.address_management.shipping', title: 'account.address_management.shippingAddress', addNewText: 'account.address_management.addNewShippingAddress' }),
|
|
9
|
+
React.createElement(AddressWrap, { type: 'account.address_management.billing', title: 'account.address_management.billingAddress', addNewText: 'account.address_management.addNewBillingAddress' }))) : (React.createElement(AddressWrap, null))));
|
|
10
10
|
};
|
|
11
11
|
export default AddressesTemplate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Text } from '@weareconceptstudio/core';
|
|
3
3
|
const EmptyAddress = () => {
|
|
4
|
-
return (React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 empty-address-text`, text: `emptyAddress` }));
|
|
4
|
+
return (React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 empty-address-text`, text: `account.address_management.emptyAddress` }));
|
|
5
5
|
};
|
|
6
6
|
export default EmptyAddress;
|
|
@@ -10,15 +10,15 @@ const SelectAddress = () => {
|
|
|
10
10
|
openPopup(React.createElement(SelectAddressPopup, { title: title, type: type }), { accountIcon: true });
|
|
11
11
|
}, []);
|
|
12
12
|
return (React.createElement("div", { className: `shipping-billing-change-wrapper` }, hasAddressType ? (React.createElement(React.Fragment, null,
|
|
13
|
-
React.createElement(AddressItem, { checkout_review: true, type: 'shipping', select_address: false, title: 'shippingAddress', data: selectedAddresses.shipping, onClick: () => handleSelectPopup({
|
|
14
|
-
title: 'selectShippingAddress',
|
|
13
|
+
React.createElement(AddressItem, { checkout_review: true, type: 'shipping', select_address: false, title: 'account.address_management.shippingAddress', data: selectedAddresses.shipping, onClick: () => handleSelectPopup({
|
|
14
|
+
title: 'account.order_balance.selectShippingAddress',
|
|
15
15
|
type: 'shipping',
|
|
16
16
|
}) }),
|
|
17
|
-
React.createElement(AddressItem, { checkout_review: true, type: 'billing', select_address: false, title: 'billingAddress', data: selectedAddresses.billing, onClick: () => handleSelectPopup({
|
|
18
|
-
title: 'selectBillingAddress',
|
|
17
|
+
React.createElement(AddressItem, { checkout_review: true, type: 'billing', select_address: false, title: 'account.address_management.billingAddress', data: selectedAddresses.billing, onClick: () => handleSelectPopup({
|
|
18
|
+
title: 'account.order_balance.selectBillingAddress',
|
|
19
19
|
type: 'billing',
|
|
20
|
-
}) }))) : (React.createElement(AddressItem, { isNote: true, checkout_review: true, type: 'shipping', title: 'address', className: 'full', select_address: false, data: selectedAddresses, onClick: () => handleSelectPopup({
|
|
21
|
-
title: 'address',
|
|
20
|
+
}) }))) : (React.createElement(AddressItem, { isNote: true, checkout_review: true, type: 'shipping', title: 'account.address_management.address', className: 'full', select_address: false, data: selectedAddresses, onClick: () => handleSelectPopup({
|
|
21
|
+
title: 'account.address_management.address',
|
|
22
22
|
type: null,
|
|
23
23
|
}) }))));
|
|
24
24
|
};
|
|
@@ -18,7 +18,7 @@ const SelectAddressPopup = Memo(({ title, type }) => {
|
|
|
18
18
|
const [refElement, setRefElement] = useState();
|
|
19
19
|
const resize = useResizeObserver(flexWrapperRef.current ? [...[...flexWrapperRef.current.children].map((item) => item)] : null);
|
|
20
20
|
const handleNewAddressPopup = () => {
|
|
21
|
-
openPopup(React.createElement(AddressForm, { title: type == 'shipping' ? `addNewShippingAddress` : type == 'billing' ? 'addNewBillingAddress' : 'addNewAddress', type: type }), {
|
|
21
|
+
openPopup(React.createElement(AddressForm, { title: type == 'shipping' ? `account.address_management.addNewShippingAddress` : type == 'billing' ? 'account.address_management.addNewBillingAddress' : 'account.address_management.addNewAddress', type: type }), {
|
|
22
22
|
accountIcon: true,
|
|
23
23
|
});
|
|
24
24
|
};
|
|
@@ -40,12 +40,12 @@ const SelectAddressPopup = Memo(({ title, type }) => {
|
|
|
40
40
|
return (React.createElement(SelectAddressPopupStyle, { ref: styleRef },
|
|
41
41
|
React.createElement("div", { className: `select-address-wrap` },
|
|
42
42
|
React.createElement(Text, { tag: `h6`, className: hasAddressType ? `account-h6 account-font-bold account-primary-color1` : 'account-p account-p2 account-font-bold account-primary-color1', text: title }),
|
|
43
|
-
React.createElement(AccountButton, { onClick: handleNewAddressPopup, text: `addNewAdd`, btnType: hasAddressType ? `purple-text` : 'green-small-text' })),
|
|
43
|
+
React.createElement(AccountButton, { onClick: handleNewAddressPopup, text: `account.order_balance.addNewAdd`, btnType: hasAddressType ? `purple-text` : 'green-small-text' })),
|
|
44
44
|
addresses?.length > 0 ? (React.createElement("div", { ref: flexWrapperRef, className: `flex-wrapper` }, addresses.map((item, index) => {
|
|
45
45
|
return (React.createElement(AddressItem, { type: type, data: item, key: index, id: item.id, select_address: true, checkedId: checkedId, checkout_review: false, setCheckedId: setCheckedId }));
|
|
46
46
|
}))) : null,
|
|
47
47
|
React.createElement("div", { className: `cancel-and-save-wrap` },
|
|
48
|
-
React.createElement(AccountButton, {
|
|
49
|
-
React.createElement(AccountButton, {
|
|
48
|
+
React.createElement(AccountButton, { onClick: closePopup, btnType: `green-large-text`, text: `account.general_actions.cancel` }),
|
|
49
|
+
React.createElement(AccountButton, { btnType: `full-width`, onClick: handleAddressChangeSubmit, text: `account.general_actions.saveAndApply` }))));
|
|
50
50
|
});
|
|
51
51
|
export default SelectAddressPopup;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import { Text } from '@weareconceptstudio/core';
|
|
2
|
+
import { Text, useTranslation } from '@weareconceptstudio/core';
|
|
3
3
|
import { useAddressContext } from '../AddressProvider';
|
|
4
4
|
//* Style
|
|
5
5
|
import ShippingBillingInfoStyle from './style';
|
|
6
6
|
// TODO: Address info to component
|
|
7
7
|
const ShippingBillingInfo = memo(({ className, shipping_address, billing_address }) => {
|
|
8
8
|
const { addressType } = useAddressContext();
|
|
9
|
+
const { translate } = useTranslation();
|
|
9
10
|
return (React.createElement(ShippingBillingInfoStyle, { className: `${className || ''}` },
|
|
10
|
-
React.createElement(Text, { className: `account-p account-p1 account-font-bold account-primary-color1`, text: addressType ? 'shippingAndBillingInfo' : 'shippingInfo' }),
|
|
11
|
+
React.createElement(Text, { className: `account-p account-p1 account-font-bold account-primary-color1`, text: addressType ? 'account.order_balance.shippingAndBillingInfo' : 'account.order_balance.shippingInfo' }),
|
|
11
12
|
React.createElement("div", { className: `info-space-line` }),
|
|
12
13
|
React.createElement("div", { className: `info-wrap shipped` },
|
|
13
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 m-bot
|
|
14
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 m-bot` },
|
|
15
|
+
translate('account.order_balance.shippedTo'),
|
|
16
|
+
":"),
|
|
14
17
|
shipping_address.map((item, index) => (React.createElement(Text, { key: index, className: `account-p account-p3 account-font-regular account-primary-color1 nowrap ${index == shipping_address.length - 1 ? 'm-top' : ''}`, text: item }))))));
|
|
15
18
|
});
|
|
16
19
|
export default ShippingBillingInfo;
|