@weareconceptstudio/account 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AccountCounter/index.d.ts +6 -0
- package/dist/components/AccountCounter/index.js +38 -0
- package/dist/components/AccountCounter/style.d.ts +2 -0
- package/dist/components/AccountCounter/style.js +79 -0
- package/dist/components/index.d.ts +5 -4
- package/dist/components/index.js +5 -4
- package/dist/modules/address/AddressItem/index.d.ts +2 -1
- package/dist/modules/address/AddressItem/index.js +18 -8
- package/dist/modules/address/AddressItem/style.js +33 -6
- package/dist/modules/address/SelectAddress/index.js +1 -1
- package/dist/modules/address/SelectAddressPopup/index.js +3 -3
- package/dist/modules/address/ShippingBillingInfo/index.js +3 -3
- package/dist/modules/address/ShippingBillingInfo/style.js +24 -24
- package/dist/modules/cart/CartTemplate/index.d.ts +2 -1
- package/dist/modules/cart/CartTemplate/index.js +2 -2
- package/dist/modules/cart/EmptyCart/icons.d.ts +1 -1
- package/dist/modules/cart/EmptyCart/icons.js +1 -1
- package/dist/modules/cart/EmptyCart/index.d.ts +2 -1
- package/dist/modules/cart/EmptyCart/index.js +4 -3
- package/dist/modules/cart/SimpleItems/ItemMobile/index.js +21 -35
- package/dist/modules/cart/SimpleItems/style.js +23 -2
- package/dist/modules/checkout/ThankYouTemplate/index.d.ts +2 -1
- package/dist/modules/checkout/ThankYouTemplate/index.js +2 -2
- package/dist/modules/order/OrderedItems/style.js +2 -1
- package/dist/modules/payment/PaymentMethodItem/index.js +1 -1
- package/dist/modules/payment/PaymentMethodItem/style.js +1 -0
- package/dist/modules/payment/SelectedPayment/index.js +1 -1
- package/dist/styles/variables.js +1 -1
- package/dist/translations/en.d.ts +236 -213
- package/dist/translations/en.js +245 -230
- package/dist/translations/hy.d.ts +1 -0
- package/dist/translations/hy.js +1 -0
- package/dist/translations/index.d.ts +238 -213
- package/dist/translations/ru.d.ts +1 -0
- package/dist/translations/ru.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
|
+
import { Text, debounce } from '@weareconceptstudio/core';
|
|
3
|
+
import { useAccountContext } from '../../AccountProvider';
|
|
4
|
+
//* Style
|
|
5
|
+
import AccountCounterStyle from './style';
|
|
6
|
+
const AccountCounter = ({ productId, qty = 1 }) => {
|
|
7
|
+
const { useCart } = useAccountContext();
|
|
8
|
+
const { toggleCartItem, items } = useCart();
|
|
9
|
+
//! State
|
|
10
|
+
const [count, setCount] = useState(qty);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
setCount(items.find((item) => item.product.id == productId)?.qty || qty);
|
|
13
|
+
}, [items]);
|
|
14
|
+
const updateCartServer = useCallback((quantity) => {
|
|
15
|
+
toggleCartItem({
|
|
16
|
+
productId,
|
|
17
|
+
qty: quantity,
|
|
18
|
+
});
|
|
19
|
+
}, [productId]);
|
|
20
|
+
const debouncedUpdateCartServer = useCallback(debounce((quantity) => updateCartServer(quantity), 300), [updateCartServer]);
|
|
21
|
+
const handleAddToCart = (e, type = 'inc') => {
|
|
22
|
+
e.stopPropagation();
|
|
23
|
+
const newCount = type == 'inc' ? count + 1 : count - 1;
|
|
24
|
+
setCount(newCount);
|
|
25
|
+
debouncedUpdateCartServer(newCount);
|
|
26
|
+
};
|
|
27
|
+
return (React.createElement(AccountCounterStyle, { onClick: (e) => e.stopPropagation(), className: `counter-block ${count == 0 ? 'opacity-zero pointer-none' : ''}` },
|
|
28
|
+
React.createElement("div", { className: 'counter' },
|
|
29
|
+
React.createElement("div", { onClick: (e) => handleAddToCart(e, 'dec'), className: `c-icon-block ${count == 0 ? 'disable' : ''}` },
|
|
30
|
+
React.createElement("svg", { fill: 'none', viewBox: '0 0 13 3', className: `minus`, xmlns: 'http://www.w3.org/2000/svg' },
|
|
31
|
+
React.createElement("path", { d: 'M0 1.5H12', strokeWidth: '2' }))),
|
|
32
|
+
React.createElement(Text, { className: `p p5 font-montserrat-arm-medium count` }, `${count}`),
|
|
33
|
+
React.createElement("div", { onClick: (e) => handleAddToCart(e, 'inc'), className: `c-icon-block ${count == 99 ? 'disable' : ''}` },
|
|
34
|
+
React.createElement("svg", { fill: 'none', className: `plus`, viewBox: '0 0 12 12', xmlns: 'http://www.w3.org/2000/svg' },
|
|
35
|
+
React.createElement("path", { d: 'M0 6H12', strokeWidth: '2' }),
|
|
36
|
+
React.createElement("path", { d: 'M6 12L6 0', strokeWidth: '2' }))))));
|
|
37
|
+
};
|
|
38
|
+
export default AccountCounter;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export default AccountCounterStyle;
|
|
2
|
+
declare const AccountCounterStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
const AccountCounterStyle = styled.div `
|
|
3
|
+
--account_counterWidth: var(--sp10x);
|
|
4
|
+
|
|
5
|
+
--account_counterHeight: var(--sp3x);
|
|
6
|
+
--account_counterIconSize: var(--sp1-5x);
|
|
7
|
+
|
|
8
|
+
width: var(--account_counterWidth);
|
|
9
|
+
height: var(--account_counterHeight);
|
|
10
|
+
display: flex;
|
|
11
|
+
transition: opacity var(--account_trTime) ease-out;
|
|
12
|
+
|
|
13
|
+
.counter {
|
|
14
|
+
width: 100%;
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
|
|
19
|
+
.count {
|
|
20
|
+
color: var(--backgroundColor);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
svg {
|
|
24
|
+
width: var(--account_counterIconSize);
|
|
25
|
+
height: var(--account_counterIconSize);
|
|
26
|
+
|
|
27
|
+
stroke: var(--backgroundColor);
|
|
28
|
+
fill: var(--backgroundColor);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.c-icon-block {
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
|
|
39
|
+
width: var(--sp3x);
|
|
40
|
+
height: var(--sp3x);
|
|
41
|
+
background-color: #f7f8f9;
|
|
42
|
+
border-radius: 50%;
|
|
43
|
+
|
|
44
|
+
&.disable {
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
opacity: 0.5;
|
|
47
|
+
cursor: default !important;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* //! 1920 */
|
|
52
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* //! 1510 */
|
|
56
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* //! 1440 */
|
|
60
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* //! 1280 */
|
|
64
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* //! 1024 */
|
|
68
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* //! 768 */
|
|
72
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* //! Mobile */
|
|
76
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
export default AccountCounterStyle;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { default as AccountButton } from './AccountButton';
|
|
2
|
-
export { default as CustomCheckbox } from './CustomCheckbox';
|
|
3
|
-
export { default as FormInputCode } from './FormInputCode';
|
|
4
|
-
export { default as Pagination } from './Pagination';
|
|
5
1
|
export { default as Sequence } from './Sequence';
|
|
2
|
+
export { default as Pagination } from './Pagination';
|
|
6
3
|
export { default as TotalCheckout } from './TotalCheckout';
|
|
4
|
+
export { default as FormInputCode } from './FormInputCode';
|
|
5
|
+
export { default as AccountButton } from './AccountButton';
|
|
6
|
+
export { default as AccountCounter } from './AccountCounter';
|
|
7
7
|
export { default as WarningMessage } from './WarningMessage';
|
|
8
|
+
export { default as CustomCheckbox } from './CustomCheckbox';
|
|
8
9
|
export { default as WarningMessageForPopup } from './WarningMessageForPopup';
|
package/dist/components/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export { default as AccountButton } from './AccountButton';
|
|
2
|
-
export { default as CustomCheckbox } from './CustomCheckbox';
|
|
3
|
-
export { default as FormInputCode } from './FormInputCode';
|
|
4
|
-
export { default as Pagination } from './Pagination';
|
|
5
1
|
export { default as Sequence } from './Sequence';
|
|
2
|
+
export { default as Pagination } from './Pagination';
|
|
6
3
|
export { default as TotalCheckout } from './TotalCheckout';
|
|
4
|
+
export { default as FormInputCode } from './FormInputCode';
|
|
5
|
+
export { default as AccountButton } from './AccountButton';
|
|
6
|
+
export { default as AccountCounter } from './AccountCounter';
|
|
7
7
|
export { default as WarningMessage } from './WarningMessage';
|
|
8
|
+
export { default as CustomCheckbox } from './CustomCheckbox';
|
|
8
9
|
export { default as WarningMessageForPopup } from './WarningMessageForPopup';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default AddressItem;
|
|
2
|
-
declare function AddressItem({ type, title, data, checkout_review, select_address, onClick, checkedId, setCheckedId, className }: {
|
|
2
|
+
declare function AddressItem({ type, title, data, checkout_review, select_address, onClick, checkedId, setCheckedId, className, isNote }: {
|
|
3
3
|
type: any;
|
|
4
4
|
title: any;
|
|
5
5
|
data: any;
|
|
@@ -9,5 +9,6 @@ declare function AddressItem({ type, title, data, checkout_review, select_addres
|
|
|
9
9
|
checkedId: any;
|
|
10
10
|
setCheckedId: any;
|
|
11
11
|
className: any;
|
|
12
|
+
isNote?: boolean;
|
|
12
13
|
}): React.JSX.Element;
|
|
13
14
|
import React from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
|
-
import { Text, useUi } from '@weareconceptstudio/core';
|
|
2
|
+
import { Text, useTranslation, useUi } from '@weareconceptstudio/core';
|
|
3
3
|
import { useAddressContext } from '../AddressProvider';
|
|
4
4
|
//* Components
|
|
5
5
|
import AddressForm from '../AddressForm';
|
|
@@ -7,9 +7,10 @@ import AccountButton from '../../../components/AccountButton';
|
|
|
7
7
|
import WarningMessageForPopup from '../../../components/WarningMessageForPopup';
|
|
8
8
|
//* Style
|
|
9
9
|
import AddressItemStyle from './style';
|
|
10
|
-
const AddressItem = ({ type, title, data, checkout_review, select_address, onClick, checkedId, setCheckedId, className }) => {
|
|
10
|
+
const AddressItem = ({ type, title, data, checkout_review, select_address, onClick, checkedId, setCheckedId, className, isNote = false }) => {
|
|
11
11
|
const { openPopup } = useUi();
|
|
12
12
|
const { deleteAddress, selectedAddresses } = useAddressContext();
|
|
13
|
+
const { translate } = useTranslation();
|
|
13
14
|
//! Handle Popups
|
|
14
15
|
const handleDeletePopup = useCallback(() => {
|
|
15
16
|
openPopup(React.createElement(WarningMessageForPopup, { isDelete: true, title: 'deleteAddressMessage', description: 'confirmDeleteAddress', onRemove: () => deleteAddress({ addressId: data.id, type: data.type }) }), {
|
|
@@ -24,19 +25,28 @@ const AddressItem = ({ type, title, data, checkout_review, select_address, onCli
|
|
|
24
25
|
}, [data]);
|
|
25
26
|
return data ? (React.createElement(AddressItemStyle, { className: `item-container ${className || ''}` },
|
|
26
27
|
checkout_review && (React.createElement("div", { className: `change-address-wrap` },
|
|
27
|
-
React.createElement(Text, { className: `account-p account-p2 account-font-bold account-primary-color1
|
|
28
|
-
React.createElement(AccountButton, { text: `change`, btnType: `green-small-text
|
|
29
|
-
React.createElement("div", { className: `item-internal-wrap` },
|
|
28
|
+
React.createElement(Text, { text: title, className: `account-p account-p2 account-font-bold account-primary-color1` }),
|
|
29
|
+
React.createElement(AccountButton, { text: `change`, onClick: onClick, btnType: `green-small-text` }))),
|
|
30
|
+
React.createElement("div", { className: `item-internal-wrap user-select-none` }, isNote && data.note_for_courier ? (React.createElement("div", { className: 'flex-box-block' },
|
|
31
|
+
React.createElement("div", { className: `relative-wrapper box-block` },
|
|
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` }))),
|
|
34
|
+
React.createElement(Text, { className: `account-p account-p3 account-primary-color1 box-block` },
|
|
35
|
+
React.createElement("span", { className: `account-font-bold` },
|
|
36
|
+
translate('note'),
|
|
37
|
+
":"),
|
|
38
|
+
" ",
|
|
39
|
+
React.createElement("span", { className: `account-font-regular` }, data.note_for_courier)))) : (React.createElement(React.Fragment, null,
|
|
30
40
|
React.createElement("div", { className: `relative-wrapper` },
|
|
31
|
-
React.createElement("div", { className: `personal-data-wrap` }, data.displayLines.map((line, index) => (React.createElement(Text, { key: index, className: `account-p account-p3 ${index == 0 ? 'account-font-bold' : 'account-font-regular'} ${index
|
|
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 })))),
|
|
32
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` })),
|
|
33
43
|
select_address && (React.createElement("div", { className: `circle-selected-wrap cursor-pointer ${checkedId == data.id ? 'active' : ''}`, onClick: () => setCheckedId(data.id) },
|
|
34
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'}` },
|
|
35
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' }))))),
|
|
36
|
-
!checkout_review
|
|
46
|
+
!checkout_review ? (React.createElement("div", { className: `edit-remove-wrapper` },
|
|
37
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' : ''}` }),
|
|
38
48
|
!select_address && !data.is_default && (React.createElement(React.Fragment, null,
|
|
39
49
|
React.createElement("div", { className: `vertical-line` }),
|
|
40
|
-
React.createElement(AccountButton, { text: `remove`, onClick: handleDeletePopup, btnType: `green-small-text`, className: `btn-more-address-version` })))))))) : null;
|
|
50
|
+
React.createElement(AccountButton, { text: `remove`, onClick: handleDeletePopup, btnType: `green-small-text`, className: `btn-more-address-version` }))))) : null))))) : null;
|
|
41
51
|
};
|
|
42
52
|
export default AddressItem;
|
|
@@ -11,6 +11,9 @@ const AddressItemStyle = styled.section `
|
|
|
11
11
|
--account_circleSize: var(--sp4x);
|
|
12
12
|
--account_checkSize: var(--sp2x);
|
|
13
13
|
|
|
14
|
+
--account_flexBoxBLockItemsGap: var(--sp4x);
|
|
15
|
+
--account_flexBoxBLockItemWidth: calc(50% - var(--account_flexBoxBLockItemsGap) / 2);
|
|
16
|
+
|
|
14
17
|
width: var(--account_itemWidth);
|
|
15
18
|
padding: 0 calc(var(--account_itemDistance) / 2);
|
|
16
19
|
|
|
@@ -32,7 +35,7 @@ const AddressItemStyle = styled.section `
|
|
|
32
35
|
height: 100%;
|
|
33
36
|
|
|
34
37
|
.personal-data-wrap {
|
|
35
|
-
.
|
|
38
|
+
.line-distance {
|
|
36
39
|
margin-top: var(--account_smallMarginDistance);
|
|
37
40
|
}
|
|
38
41
|
}
|
|
@@ -86,11 +89,6 @@ const AddressItemStyle = styled.section `
|
|
|
86
89
|
color: var(--account_backgroundColor);
|
|
87
90
|
}
|
|
88
91
|
|
|
89
|
-
&.active {
|
|
90
|
-
border: 2px solid var(--account_primaryColor1);
|
|
91
|
-
background-color: var(--account_primaryColor1);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
92
|
.checkbox-icon {
|
|
95
93
|
display: flex;
|
|
96
94
|
justify-content: center;
|
|
@@ -100,6 +98,12 @@ const AddressItemStyle = styled.section `
|
|
|
100
98
|
height: var(--account_checkSize);
|
|
101
99
|
fill: var(--account_backgroundColor);
|
|
102
100
|
}
|
|
101
|
+
|
|
102
|
+
&.active {
|
|
103
|
+
border: 2px solid var(--account_primaryColor1);
|
|
104
|
+
background-color: var(--account_primaryColor1);
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
}
|
|
103
107
|
}
|
|
104
108
|
}
|
|
105
109
|
}
|
|
@@ -121,6 +125,16 @@ const AddressItemStyle = styled.section `
|
|
|
121
125
|
}
|
|
122
126
|
}
|
|
123
127
|
|
|
128
|
+
.flex-box-block {
|
|
129
|
+
display: flex;
|
|
130
|
+
flex-wrap: wrap;
|
|
131
|
+
gap: var(--account_flexBoxBLockItemsGap);
|
|
132
|
+
|
|
133
|
+
.box-block {
|
|
134
|
+
width: var(--account_flexBoxBLockItemWidth);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
124
138
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
125
139
|
--account_itemInternalWrapPad: var(--sp3x);
|
|
126
140
|
--account_verticalLineHeight: var(--sp1-5x);
|
|
@@ -139,6 +153,8 @@ const AddressItemStyle = styled.section `
|
|
|
139
153
|
--account_changeAddressWrapMBot: var(--sp4x);
|
|
140
154
|
--account_circleSize: var(--sp3x);
|
|
141
155
|
--account_checkSize: var(--sp1-5x);
|
|
156
|
+
|
|
157
|
+
--account_flexBoxBLockItemsGap: var(--sp3x);
|
|
142
158
|
}
|
|
143
159
|
|
|
144
160
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
@@ -150,6 +166,8 @@ const AddressItemStyle = styled.section `
|
|
|
150
166
|
--account_changeAddressWrapMBot: var(--sp3x);
|
|
151
167
|
--account_circleSize: var(--sp3x);
|
|
152
168
|
--account_checkSize: var(--sp1-5x);
|
|
169
|
+
|
|
170
|
+
--account_flexBoxBLockItemsGap: var(--sp3x);
|
|
153
171
|
}
|
|
154
172
|
|
|
155
173
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
@@ -161,6 +179,8 @@ const AddressItemStyle = styled.section `
|
|
|
161
179
|
--account_changeAddressWrapMBot: var(--sp3x);
|
|
162
180
|
--account_circleSize: var(--sp2-5x);
|
|
163
181
|
--account_checkSize: var(--sp1x);
|
|
182
|
+
|
|
183
|
+
--account_flexBoxBLockItemsGap: var(--sp3x);
|
|
164
184
|
}
|
|
165
185
|
|
|
166
186
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
@@ -172,6 +192,8 @@ const AddressItemStyle = styled.section `
|
|
|
172
192
|
--account_changeAddressWrapMBot: var(--sp3x);
|
|
173
193
|
--account_circleSize: var(--sp2-5x);
|
|
174
194
|
--account_checkSize: var(--sp1x);
|
|
195
|
+
|
|
196
|
+
--account_flexBoxBLockItemsGap: var(--sp3x);
|
|
175
197
|
}
|
|
176
198
|
|
|
177
199
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
@@ -184,6 +206,8 @@ const AddressItemStyle = styled.section `
|
|
|
184
206
|
--account_changeAddressWrapMBot: var(--sp3x);
|
|
185
207
|
--account_circleSize: var(--sp2-5x);
|
|
186
208
|
--account_checkSize: var(--sp1x);
|
|
209
|
+
|
|
210
|
+
--account_flexBoxBLockItemsGap: var(--sp3x);
|
|
187
211
|
}
|
|
188
212
|
|
|
189
213
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
@@ -197,6 +221,9 @@ const AddressItemStyle = styled.section `
|
|
|
197
221
|
--account_circleSize: var(--sp2-5x);
|
|
198
222
|
--account_checkSize: var(--sp1x);
|
|
199
223
|
|
|
224
|
+
--account_flexBoxBLockItemsGap: var(--sp3x);
|
|
225
|
+
--account_flexBoxBLockItemWidth: 100%;
|
|
226
|
+
|
|
200
227
|
&:nth-child(2) {
|
|
201
228
|
margin-top: var(--account_itemDistance);
|
|
202
229
|
}
|
|
@@ -17,7 +17,7 @@ const SelectAddress = () => {
|
|
|
17
17
|
React.createElement(AddressItem, { checkout_review: true, type: 'billing', select_address: false, title: 'billingAddress', data: selectedAddresses.billing, onClick: () => handleSelectPopup({
|
|
18
18
|
title: 'selectBillingAddress',
|
|
19
19
|
type: 'billing',
|
|
20
|
-
}) }))) : (React.createElement(AddressItem, { checkout_review: true, type: 'shipping', title: 'address', className: 'full', select_address: false, data: selectedAddresses, onClick: () => handleSelectPopup({
|
|
20
|
+
}) }))) : (React.createElement(AddressItem, { isNote: true, checkout_review: true, type: 'shipping', title: 'address', className: 'full', select_address: false, data: selectedAddresses, onClick: () => handleSelectPopup({
|
|
21
21
|
title: 'address',
|
|
22
22
|
type: null,
|
|
23
23
|
}) }))));
|
|
@@ -42,10 +42,10 @@ const SelectAddressPopup = Memo(({ title, type }) => {
|
|
|
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
43
|
React.createElement(AccountButton, { onClick: handleNewAddressPopup, text: `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
|
-
return (React.createElement(AddressItem, {
|
|
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, { text: `cancel`, onClick: closePopup, btnType: `green-large-text` }),
|
|
49
|
+
React.createElement(AccountButton, { text: `saveAndApply`, btnType: `full-width`, onClick: handleAddressChangeSubmit }))));
|
|
50
50
|
});
|
|
51
51
|
export default SelectAddressPopup;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { Text } from '@weareconceptstudio/core';
|
|
3
|
+
import { useAddressContext } from '../AddressProvider';
|
|
3
4
|
//* Style
|
|
4
5
|
import ShippingBillingInfoStyle from './style';
|
|
5
|
-
import { useAddressContext } from '../AddressProvider';
|
|
6
6
|
// TODO: Address info to component
|
|
7
7
|
const ShippingBillingInfo = memo(({ className, shipping_address, billing_address }) => {
|
|
8
8
|
const { addressType } = useAddressContext();
|
|
@@ -10,7 +10,7 @@ const ShippingBillingInfo = memo(({ className, shipping_address, billing_address
|
|
|
10
10
|
React.createElement(Text, { className: `account-p account-p1 account-font-bold account-primary-color1`, text: addressType ? 'shippingAndBillingInfo' : 'shippingInfo' }),
|
|
11
11
|
React.createElement("div", { className: `info-space-line` }),
|
|
12
12
|
React.createElement("div", { className: `info-wrap shipped` },
|
|
13
|
-
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1
|
|
14
|
-
shipping_address.map((item, index) => (React.createElement(Text, { key: index, className: `account-p account-p3 account-font-regular account-primary-color1 nowrap`, text: item }))))));
|
|
13
|
+
React.createElement(Text, { className: `account-p account-p3 account-font-bold account-primary-color1 m-bot`, text: `shippedTo` }),
|
|
14
|
+
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
15
|
});
|
|
16
16
|
export default ShippingBillingInfo;
|
|
@@ -2,9 +2,9 @@ import styled from 'styled-components';
|
|
|
2
2
|
const ShippingBillingInfoStyle = styled.section `
|
|
3
3
|
--account_spaceLineMTop: var(--sp3x);
|
|
4
4
|
--account_spaceLineMBot: var(--sp5x);
|
|
5
|
-
--
|
|
5
|
+
--account_mBot: var(--sp2x);
|
|
6
6
|
--account_billedMTop: var(--sp5x);
|
|
7
|
-
--
|
|
7
|
+
--account_mTop: var(--sp1x);
|
|
8
8
|
--account_infoWrapWidth: 57%;
|
|
9
9
|
|
|
10
10
|
.info-space-line {
|
|
@@ -16,80 +16,80 @@ const ShippingBillingInfoStyle = styled.section `
|
|
|
16
16
|
|
|
17
17
|
.info-wrap {
|
|
18
18
|
width: var(--account_infoWrapWidth);
|
|
19
|
-
|
|
20
|
-
.value {
|
|
21
|
-
margin-bottom: var(--account_valueMBot);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.phone {
|
|
25
|
-
margin-top: var(--account_phoneMTop);
|
|
26
|
-
}
|
|
27
19
|
}
|
|
28
20
|
|
|
29
21
|
.billed {
|
|
30
22
|
margin-top: var(--account_billedMTop);
|
|
31
23
|
}
|
|
32
24
|
|
|
25
|
+
.m-bot {
|
|
26
|
+
margin-bottom: var(--account_mBot);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.m-top {
|
|
30
|
+
margin-top: var(--account_mTop);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
33
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
34
34
|
--account_spaceLineMTop: var(--sp2x);
|
|
35
35
|
--account_spaceLineMBot: var(--sp4x);
|
|
36
|
-
--
|
|
36
|
+
--account_mBot: var(--sp1x);
|
|
37
37
|
--account_billedMTop: var(--sp4x);
|
|
38
|
-
--
|
|
38
|
+
--account_mTop: var(--sp1x);
|
|
39
39
|
--account_infoWrapWidth: 46.3%;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
|
|
43
43
|
--account_spaceLineMTop: var(--sp2x);
|
|
44
44
|
--account_spaceLineMBot: var(--sp4x);
|
|
45
|
-
--
|
|
45
|
+
--account_mBot: var(--sp1x);
|
|
46
46
|
--account_billedMTop: var(--sp4x);
|
|
47
|
-
--
|
|
47
|
+
--account_mTop: var(--sp1x);
|
|
48
48
|
--account_infoWrapWidth: 58.3%;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
52
52
|
--account_spaceLineMTop: var(--sp2x);
|
|
53
53
|
--account_spaceLineMBot: var(--sp3x);
|
|
54
|
-
--
|
|
54
|
+
--account_mBot: var(--sp1x);
|
|
55
55
|
--account_billedMTop: var(--sp3x);
|
|
56
|
-
--
|
|
56
|
+
--account_mTop: var(--sp1x);
|
|
57
57
|
--account_infoWrapWidth: 61.3%;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
61
61
|
--account_spaceLineMTop: var(--sp2x);
|
|
62
62
|
--account_spaceLineMBot: var(--sp3x);
|
|
63
|
-
--
|
|
63
|
+
--account_mBot: var(--sp1x);
|
|
64
64
|
--account_billedMTop: var(--sp3x);
|
|
65
|
-
--
|
|
65
|
+
--account_mTop: var(--sp1x);
|
|
66
66
|
--account_infoWrapWidth: 66.3%;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
70
70
|
--account_spaceLineMTop: var(--sp2x);
|
|
71
71
|
--account_spaceLineMBot: var(--sp3x);
|
|
72
|
-
--
|
|
72
|
+
--account_mBot: var(--sp1x);
|
|
73
73
|
--account_billedMTop: var(--sp3x);
|
|
74
|
-
--
|
|
74
|
+
--account_mTop: var(--sp1x);
|
|
75
75
|
--account_infoWrapWidth: 82.3%;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
79
79
|
--account_spaceLineMTop: var(--sp2x);
|
|
80
80
|
--account_spaceLineMBot: var(--sp2x);
|
|
81
|
-
--
|
|
81
|
+
--account_mBot: var(--sp1x);
|
|
82
82
|
--account_billedMTop: var(--sp2x);
|
|
83
|
-
--
|
|
83
|
+
--account_mTop: var(--sp1x);
|
|
84
84
|
--account_infoWrapWidth: 74.3%;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
88
88
|
--account_spaceLineMTop: var(--sp2x);
|
|
89
89
|
--account_spaceLineMBot: var(--sp2x);
|
|
90
|
-
--
|
|
90
|
+
--account_mBot: var(--sp1x);
|
|
91
91
|
--account_billedMTop: var(--sp2x);
|
|
92
|
-
--
|
|
92
|
+
--account_mTop: var(--sp1x);
|
|
93
93
|
--account_infoWrapWidth: 67.3%;
|
|
94
94
|
|
|
95
95
|
margin-top: var(--sp5x);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export default CartTemplate;
|
|
2
|
-
declare function CartTemplate({ children, actions, checkoutUrl, moreMenu }: {
|
|
2
|
+
declare function CartTemplate({ children, actions, checkoutUrl, moreMenu, emptyCartIcon }: {
|
|
3
3
|
children: any;
|
|
4
4
|
actions: any;
|
|
5
5
|
checkoutUrl?: string;
|
|
6
6
|
moreMenu: any;
|
|
7
|
+
emptyCartIcon: any;
|
|
7
8
|
}): React.JSX.Element;
|
|
8
9
|
import React from 'react';
|
|
@@ -12,7 +12,7 @@ const leftArrow = (React.createElement("svg", { fill: 'none', viewBox: '0 0 16 1
|
|
|
12
12
|
import CartTemplateStyle from './style';
|
|
13
13
|
//* Skeleton
|
|
14
14
|
import SkeletonCartTemplate from './Skeleton';
|
|
15
|
-
const CartTemplate = ({ children, actions, checkoutUrl = '/checkout/', moreMenu }) => {
|
|
15
|
+
const CartTemplate = ({ children, actions, checkoutUrl = '/checkout/', moreMenu, emptyCartIcon }) => {
|
|
16
16
|
const { shopUrl, useCart } = useAccountContext();
|
|
17
17
|
const { translate } = useTranslation();
|
|
18
18
|
const { items, itemsCount, shippingCost, loading, subtotal, total, freeShippingRange, shippingCostValue } = useCart();
|
|
@@ -33,7 +33,7 @@ const CartTemplate = ({ children, actions, checkoutUrl = '/checkout/', moreMenu
|
|
|
33
33
|
edit: { list: false },
|
|
34
34
|
} }),
|
|
35
35
|
shopUrl ? (React.createElement(AccountButton, { url: shopUrl, btnType: `purple-text`, text: `continueShopping`, className: `continue-shop-text` })) : null,
|
|
36
|
-
moreMenu ? moreMenu : null)) : (React.createElement(EmptyCart, { data: items, shoppingUrl: shopUrl }))) : (React.createElement(SkeletonCartTemplate, { shopUrl: shopUrl }))),
|
|
36
|
+
moreMenu ? moreMenu : null)) : (React.createElement(EmptyCart, { data: items, shoppingUrl: shopUrl, emptyCartIcon: emptyCartIcon }))) : (React.createElement(SkeletonCartTemplate, { shopUrl: shopUrl }))),
|
|
37
37
|
children))));
|
|
38
38
|
};
|
|
39
39
|
export default CartTemplate;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const emptyCartIconDefault: React.JSX.Element;
|
|
2
2
|
import React from 'react';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export const
|
|
2
|
+
export const emptyCartIconDefault = (React.createElement("svg", { xmlns: 'http://www.w3.org/2000/svg', width: '129', height: '181', viewBox: '0 0 129 181' },
|
|
3
3
|
React.createElement("g", { clipPath: 'url(#clip0_2872_19370)' },
|
|
4
4
|
React.createElement("path", { d: 'M107.4 170.413C98.7374 169.552 91.9468 162.232 91.9468 153.353C91.9468 144.474 98.4753 137.445 106.897 136.355L106.743 126.038L97.9344 83.301H14.4453L23.4912 125.548C23.512 125.656 23.5245 125.764 23.5245 125.872V180.963H107.554L107.396 170.421L107.4 170.413Z' }),
|
|
5
5
|
React.createElement("path", { d: 'M0 126.292V180.959H20.4385V126.03L10.3482 78.9113L0 126.292Z' }),
|
|
@@ -3,11 +3,12 @@ import { Text } from '@weareconceptstudio/core';
|
|
|
3
3
|
import { AccountButton } from '../../../components';
|
|
4
4
|
//* Style
|
|
5
5
|
import EmptyCartStyle from './style';
|
|
6
|
-
import {
|
|
7
|
-
const EmptyCart = ({ shoppingUrl }) => {
|
|
6
|
+
import { emptyCartIconDefault } from './icons';
|
|
7
|
+
const EmptyCart = ({ shoppingUrl, emptyCartIcon }) => {
|
|
8
|
+
console.log(emptyCartIcon);
|
|
8
9
|
return (React.createElement(EmptyCartStyle, null,
|
|
9
10
|
React.createElement("div", { className: `empty-cart-wrap` },
|
|
10
|
-
React.createElement("div", { className: 'wrapper-icon' },
|
|
11
|
+
emptyCartIcon ? emptyCartIcon : React.createElement("div", { className: 'wrapper-icon' }, emptyCartIconDefault),
|
|
11
12
|
React.createElement(Text, { tag: `h4`, className: `account-h6 account-font-bold account-primary-color1 empty-cart-title`, text: `cartEmpty` }),
|
|
12
13
|
React.createElement(Text, { className: `account-p account-p2 account-font-regular account-primary-color1 empty-cart-description`, text: `cartEmptyDesc` }),
|
|
13
14
|
shoppingUrl ? (React.createElement(AccountButton, { text: `shopNow`, url: shoppingUrl, btnType: 'purple-text', className: 'empty-cart-btn' })) : null)));
|