@weareconceptstudio/account 0.3.2 → 0.3.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/Loader/index.d.ts +2 -0
- package/dist/components/Loader/index.js +7 -0
- package/dist/components/Loader/style.d.ts +2 -0
- package/dist/components/Loader/style.js +3 -0
- package/dist/components/TotalCheckout/MuramoneyComp/index.d.ts +2 -1
- package/dist/components/TotalCheckout/MuramoneyComp/index.js +2 -2
- package/dist/components/TotalCheckout/MuramoneyComp/utils.d.ts +1 -0
- package/dist/components/TotalCheckout/MuramoneyComp/utils.js +1 -0
- package/dist/components/TotalCheckout/PromoCodeComp/index.d.ts +2 -1
- package/dist/components/TotalCheckout/PromoCodeComp/index.js +2 -2
- package/dist/components/TotalCheckout/index.js +35 -4
- package/dist/components/TotalCheckout/style.js +10 -0
- package/dist/modules/account/AccountBalanceTemplate/HistoryBalance/ItemHistory/index.js +6 -1
- package/dist/modules/address/AddressForm/style.js +5 -0
- package/dist/modules/address/ShippingBillingForm/style.js +5 -0
- package/dist/modules/address/ShippingBillingInfo/index.js +1 -4
- package/dist/modules/checkout/CheckoutProvider.js +3 -2
- package/dist/modules/checkout/CheckoutTemplate/StepReview/index.js +4 -3
- package/dist/modules/order/OrderDetails/index.js +6 -1
- package/dist/{components/TotalCheckout → modules/payment}/AddNewCard/index.d.ts +1 -2
- package/dist/{components/TotalCheckout → modules/payment}/AddNewCard/index.js +2 -2
- package/dist/{components/TotalCheckout → modules/payment}/CardComp/index.d.ts +3 -2
- package/dist/{components/TotalCheckout → modules/payment}/CardComp/index.js +14 -18
- package/dist/{components/TotalCheckout → modules/payment}/CardComp/style.js +20 -6
- package/dist/{components/TotalCheckout → modules/payment}/PaymentComp/index.js +4 -3
- package/dist/{components/TotalCheckout → modules/payment}/PaymentMethodsComp/index.d.ts +2 -2
- package/dist/{components/TotalCheckout → modules/payment}/PaymentMethodsComp/index.js +8 -10
- package/dist/modules/payment/PaymentMethodsTemplate/index.js +16 -20
- package/dist/modules/payment/PaymentMethodsTemplate/style.js +12 -16
- package/dist/modules/payment/PaymentWrap/index.d.ts +6 -0
- package/dist/modules/payment/PaymentWrap/index.js +26 -0
- package/dist/modules/payment/PaymentWrap/style.d.ts +2 -0
- package/dist/{components/TotalCheckout/SelectPaymentMethodPopup → modules/payment/PaymentWrap}/style.js +11 -55
- package/dist/modules/payment/SelectPaymentMethodPopup/index.d.ts +3 -0
- package/dist/modules/payment/SelectPaymentMethodPopup/index.js +25 -0
- package/dist/modules/payment/SelectPaymentMethodPopup/style.js +81 -0
- package/dist/translations/en.d.ts +3 -0
- package/dist/translations/en.js +4 -0
- package/dist/translations/hy.d.ts +3 -0
- package/dist/translations/hy.js +4 -0
- package/dist/translations/index.d.ts +9 -0
- package/dist/translations/ru.d.ts +3 -0
- package/dist/translations/ru.js +4 -0
- package/package.json +1 -1
- package/dist/components/TotalCheckout/SelectPaymentMethodPopup/index.d.ts +0 -3
- package/dist/components/TotalCheckout/SelectPaymentMethodPopup/index.js +0 -35
- /package/dist/{components/TotalCheckout → modules/payment}/AddNewCard/style.d.ts +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/AddNewCard/style.js +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/CardComp/style.d.ts +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/PaymentComp/index.d.ts +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/PaymentComp/style.d.ts +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/PaymentComp/style.js +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/PaymentMethodsComp/icons.d.ts +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/PaymentMethodsComp/icons.js +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/PaymentMethodsComp/style.d.ts +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/PaymentMethodsComp/style.js +0 -0
- /package/dist/{components/TotalCheckout → modules/payment}/SelectPaymentMethodPopup/style.d.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
const PaymentStyle = styled.div `
|
|
3
3
|
--account_payMethodsWrapMarginT: var(--sp4x);
|
|
4
|
+
--account_payButtonMarginT: var(--sp6x);
|
|
4
5
|
--account_lineMTop: var(--sp4x);
|
|
5
6
|
--account_lineMBottom: var(--sp4x);
|
|
6
7
|
--account_payMethodsItemDistance: var(--sp5x);
|
|
@@ -15,29 +16,18 @@ const PaymentStyle = styled.div `
|
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
.flex-wrapper {
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-wrap: wrap;
|
|
20
|
-
gap: var(--account_payMethodsItemDistance);
|
|
21
19
|
margin-top: var(--account_payMethodsWrapMarginT);
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.line {
|
|
29
|
-
width: 100%;
|
|
30
|
-
height: 2px;
|
|
31
|
-
background-color: var(--account_primaryColor5);
|
|
32
|
-
margin: var(--account_lineMTop) 0 var(--account_lineMBottom);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.custom-payment-options {
|
|
36
|
-
width: var(--account_radioWrapperWidth) !important;
|
|
22
|
+
.account-payment-btn-wrapper {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: end;
|
|
25
|
+
margin-top: var(--account_payButtonMarginT);
|
|
37
26
|
}
|
|
38
27
|
|
|
39
28
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
40
29
|
--account_payMethodsItemDistance: var(--sp5x);
|
|
30
|
+
--account_payButtonMarginT: var(--sp5x);
|
|
41
31
|
--account_payMethodsWrapMarginT: var(--sp4x);
|
|
42
32
|
--account_lineMTop: var(--sp3x);
|
|
43
33
|
--account_lineMBottom: var(--sp4x);
|
|
@@ -45,6 +35,7 @@ const PaymentStyle = styled.div `
|
|
|
45
35
|
|
|
46
36
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
|
|
47
37
|
--account_payMethodsItemDistance: var(--sp4x);
|
|
38
|
+
--account_payButtonMarginT: var(--sp4x);
|
|
48
39
|
--account_payMethodsWrapMarginT: var(--sp3x);
|
|
49
40
|
--account_lineMTop: var(--sp3x);
|
|
50
41
|
--account_lineMBottom: var(--sp4x);
|
|
@@ -52,6 +43,7 @@ const PaymentStyle = styled.div `
|
|
|
52
43
|
|
|
53
44
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
54
45
|
--account_payMethodsItemDistance: var(--sp3x);
|
|
46
|
+
--account_payButtonMarginT: var(--sp4x);
|
|
55
47
|
--account_payMethodsWrapMarginT: var(--sp3x);
|
|
56
48
|
--account_lineMTop: var(--sp3x);
|
|
57
49
|
--account_lineMBottom: var(--sp3x);
|
|
@@ -59,6 +51,7 @@ const PaymentStyle = styled.div `
|
|
|
59
51
|
|
|
60
52
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
61
53
|
--account_payMethodsItemDistance: var(--sp2x);
|
|
54
|
+
--account_payButtonMarginT: var(--sp3x);
|
|
62
55
|
--account_payMethodsWrapMarginT: var(--sp3x);
|
|
63
56
|
--account_lineMTop: var(--sp2-5x);
|
|
64
57
|
--account_lineMBottom: var(--sp2x);
|
|
@@ -66,6 +59,7 @@ const PaymentStyle = styled.div `
|
|
|
66
59
|
|
|
67
60
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
68
61
|
--account_payMethodsItemDistance: var(--sp3x);
|
|
62
|
+
--account_payButtonMarginT: var(--sp3x);
|
|
69
63
|
--account_payMethodsWrapMarginT: var(--sp2x);
|
|
70
64
|
--account_lineMTop: var(--sp2-5x);
|
|
71
65
|
--account_lineMBottom: var(--sp2x);
|
|
@@ -73,6 +67,7 @@ const PaymentStyle = styled.div `
|
|
|
73
67
|
|
|
74
68
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
75
69
|
--account_payMethodsItemDistance: var(--sp2x);
|
|
70
|
+
--account_payButtonMarginT: var(--sp2x);
|
|
76
71
|
--account_payMethodsWrapMarginT: var(--sp3x);
|
|
77
72
|
--account_lineMTop: var(--sp2x);
|
|
78
73
|
--account_lineMBottom: var(--sp3x);
|
|
@@ -80,6 +75,7 @@ const PaymentStyle = styled.div `
|
|
|
80
75
|
|
|
81
76
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
82
77
|
--account_payMethodsItemDistance: var(--sp1x);
|
|
78
|
+
--account_payButtonMarginT: var(--sp1-5x);
|
|
83
79
|
--account_payMethodsWrapMarginT: var(--sp2x);
|
|
84
80
|
--account_lineMTop: var(--sp2x);
|
|
85
81
|
--account_lineMBottom: var(--sp2x);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
//* Components
|
|
3
|
+
import PaymentMethodsComp from '../PaymentMethodsComp';
|
|
4
|
+
import AddNewCard from '../AddNewCard';
|
|
5
|
+
import CardComp from '../CardComp';
|
|
6
|
+
//* Style
|
|
7
|
+
import PaymentWrapStyle from './style';
|
|
8
|
+
import { useAccountContext } from '../../../AccountProvider';
|
|
9
|
+
import { api } from '@weareconceptstudio/core';
|
|
10
|
+
const PaymentWrap = ({ selectedPayment, setSelectedPayment }) => {
|
|
11
|
+
const { useUser } = useAccountContext();
|
|
12
|
+
const { user } = useUser();
|
|
13
|
+
const [cards, setCards] = useState(user.cards);
|
|
14
|
+
const deleteCard = async (cardId) => {
|
|
15
|
+
await api.post('delete-card', { card_id: cardId }).then(() => {
|
|
16
|
+
setCards((prev) => prev.filter((item) => item.id != cardId));
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
return (React.createElement(PaymentWrapStyle, null,
|
|
20
|
+
React.createElement("div", { className: `flex-wrapper` },
|
|
21
|
+
React.createElement(AddNewCard, null),
|
|
22
|
+
cards?.map((card, index) => (React.createElement(CardComp, { key: index, cardOption: card, selectedPayment: selectedPayment, setSelectedPayment: setSelectedPayment, deleteCard: deleteCard })))),
|
|
23
|
+
React.createElement("div", { className: 'line' }),
|
|
24
|
+
React.createElement(PaymentMethodsComp, { showAll: true, selectedPayment: selectedPayment, setSelectedPayment: setSelectedPayment })));
|
|
25
|
+
};
|
|
26
|
+
export default PaymentWrap;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export default PaymentWrapStyle;
|
|
2
|
+
declare const PaymentWrapStyle: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
const
|
|
3
|
-
--
|
|
4
|
-
--account_cancelDistance: var(--sp5x);
|
|
5
|
-
--account_selectAddressWrapMBot: var(--sp5x);
|
|
2
|
+
const PaymentWrapStyle = styled.section `
|
|
3
|
+
--account_selectPaymentWrapMBot: var(--sp5x);
|
|
6
4
|
--account_payMethodsItemDistance: var(--sp5x);
|
|
7
5
|
--account_payMethodsItemInternalPad: var(--sp2x);
|
|
8
6
|
--account_radioWrapperWidth: calc(50% - var(--account_payMethodsItemDistance) / 2);
|
|
@@ -18,7 +16,7 @@ const SelectPaymentMethodPopupStyle = styled.section `
|
|
|
18
16
|
flex-wrap: wrap;
|
|
19
17
|
justify-content: space-between;
|
|
20
18
|
align-items: center;
|
|
21
|
-
margin-bottom: var(--
|
|
19
|
+
margin-bottom: var(--account_selectPaymentWrapMBot);
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
.flex-wrapper {
|
|
@@ -32,19 +30,6 @@ const SelectPaymentMethodPopupStyle = styled.section `
|
|
|
32
30
|
padding: var(--account_payMethodsItemInternalPad) !important;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
|
-
.cancel-and-save-wrap {
|
|
36
|
-
display: flex;
|
|
37
|
-
justify-content: flex-end;
|
|
38
|
-
align-items: center;
|
|
39
|
-
margin-top: var(--account_cancelAndSaveWrapMTop);
|
|
40
|
-
|
|
41
|
-
.btn-wrap {
|
|
42
|
-
&:first-child {
|
|
43
|
-
margin-right: var(--account_cancelDistance);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
33
|
.line {
|
|
49
34
|
width: 100%;
|
|
50
35
|
height: 2px;
|
|
@@ -53,9 +38,7 @@ const SelectPaymentMethodPopupStyle = styled.section `
|
|
|
53
38
|
}
|
|
54
39
|
|
|
55
40
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
56
|
-
--
|
|
57
|
-
--account_cancelDistance: var(--sp3x);
|
|
58
|
-
--account_selectAddressWrapMBot: var(--sp4x);
|
|
41
|
+
--account_selectPaymentWrapMBot: var(--sp4x);
|
|
59
42
|
--account_payMethodsItemDistance: var(--sp5x);
|
|
60
43
|
--account_payMethodsItemInternalPad: var(--sp2x);
|
|
61
44
|
--account_radioWrapperWidth: calc(50% - var(--account_payMethodsItemDistance) / 2);
|
|
@@ -64,9 +47,7 @@ const SelectPaymentMethodPopupStyle = styled.section `
|
|
|
64
47
|
}
|
|
65
48
|
|
|
66
49
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
|
|
67
|
-
--
|
|
68
|
-
--account_cancelDistance: var(--sp3x);
|
|
69
|
-
--account_selectAddressWrapMBot: var(--sp3x);
|
|
50
|
+
--account_selectPaymentWrapMBot: var(--sp3x);
|
|
70
51
|
--account_payMethodsItemDistance: var(--sp4x);
|
|
71
52
|
--account_payMethodsItemInternalPad: var(--sp1-5x);
|
|
72
53
|
--account_radioWrapperWidth: calc(50% - var(--account_payMethodsItemDistance) / 2);
|
|
@@ -75,9 +56,7 @@ const SelectPaymentMethodPopupStyle = styled.section `
|
|
|
75
56
|
}
|
|
76
57
|
|
|
77
58
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
78
|
-
--
|
|
79
|
-
--account_cancelDistance: var(--sp3x);
|
|
80
|
-
--account_selectAddressWrapMBot: var(--sp3x);
|
|
59
|
+
--account_selectPaymentWrapMBot: var(--sp3x);
|
|
81
60
|
--account_payMethodsItemDistance: var(--sp3x);
|
|
82
61
|
--account_payMethodsItemInternalPad: var(--sp1-5x);
|
|
83
62
|
--account_radioWrapperWidth: calc(50% - var(--account_payMethodsItemDistance) / 2);
|
|
@@ -86,9 +65,7 @@ const SelectPaymentMethodPopupStyle = styled.section `
|
|
|
86
65
|
}
|
|
87
66
|
|
|
88
67
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
89
|
-
--
|
|
90
|
-
--account_cancelDistance: var(--sp2-5x);
|
|
91
|
-
--account_selectAddressWrapMBot: var(--sp3x);
|
|
68
|
+
--account_selectPaymentWrapMBot: var(--sp3x);
|
|
92
69
|
--account_payMethodsItemDistance: var(--sp2x);
|
|
93
70
|
--account_payMethodsItemInternalPad: var(--sp1-5x);
|
|
94
71
|
--account_radioWrapperWidth: calc(50% - var(--account_payMethodsItemDistance) / 2);
|
|
@@ -97,9 +74,7 @@ const SelectPaymentMethodPopupStyle = styled.section `
|
|
|
97
74
|
}
|
|
98
75
|
|
|
99
76
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
100
|
-
--
|
|
101
|
-
--account_cancelDistance: var(--sp2-5x);
|
|
102
|
-
--account_selectAddressWrapMBot: var(--sp3x);
|
|
77
|
+
--account_selectPaymentWrapMBot: var(--sp3x);
|
|
103
78
|
--account_payMethodsItemDistance: var(--sp3x);
|
|
104
79
|
--account_payMethodsItemInternalPad: var(--sp1-5x);
|
|
105
80
|
--account_radioWrapperWidth: calc(50% - var(--account_payMethodsItemDistance) / 2);
|
|
@@ -108,9 +83,7 @@ const SelectPaymentMethodPopupStyle = styled.section `
|
|
|
108
83
|
}
|
|
109
84
|
|
|
110
85
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
111
|
-
--
|
|
112
|
-
--account_cancelDistance: var(--sp2-5x);
|
|
113
|
-
--account_selectAddressWrapMBot: var(--sp3x);
|
|
86
|
+
--account_selectPaymentWrapMBot: var(--sp3x);
|
|
114
87
|
--account_payMethodsItemDistance: var(--sp2x);
|
|
115
88
|
--account_payMethodsItemInternalPad: var(--sp1-5x);
|
|
116
89
|
--account_radioWrapperWidth: calc(50% - var(--account_payMethodsItemDistance) / 2);
|
|
@@ -119,29 +92,12 @@ const SelectPaymentMethodPopupStyle = styled.section `
|
|
|
119
92
|
}
|
|
120
93
|
|
|
121
94
|
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
122
|
-
--
|
|
123
|
-
--account_cancelDistance: var(--sp2x);
|
|
124
|
-
--account_selectAddressWrapMBot: var(--sp3x);
|
|
95
|
+
--account_selectPaymentWrapMBot: var(--sp3x);
|
|
125
96
|
--account_payMethodsItemDistance: var(--sp1x);
|
|
126
97
|
--account_payMethodsItemInternalPad: var(--sp1-5x);
|
|
127
98
|
--account_radioWrapperWidth: 100%;
|
|
128
99
|
--account_lineMTop: var(--sp2x);
|
|
129
100
|
--account_lineMBottom: var(--sp2x);
|
|
130
|
-
|
|
131
|
-
.cancel-and-save-wrap {
|
|
132
|
-
flex-direction: column-reverse;
|
|
133
|
-
|
|
134
|
-
.btn-wrap {
|
|
135
|
-
&:first-child {
|
|
136
|
-
margin-right: 0;
|
|
137
|
-
margin-top: var(--account_cancelDistance);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
&:last-child {
|
|
141
|
-
width: 100%;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
101
|
}
|
|
146
102
|
`;
|
|
147
|
-
export default
|
|
103
|
+
export default PaymentWrapStyle;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { useUi, Text } from '@weareconceptstudio/core';
|
|
3
|
+
import { useCheckoutContext } from '../../checkout';
|
|
4
|
+
//* Components
|
|
5
|
+
import AccountButton from '../../../components/AccountButton';
|
|
6
|
+
import PaymentWrap from '../PaymentWrap';
|
|
7
|
+
//* Style
|
|
8
|
+
import SelectPaymentMethodPopupStyle from './style';
|
|
9
|
+
const SelectPaymentMethodPopup = () => {
|
|
10
|
+
const { closePopup } = useUi();
|
|
11
|
+
const { checkoutData, fillCheckoutData } = useCheckoutContext();
|
|
12
|
+
const [selectedPayment, setSelectedPayment] = useState(checkoutData.paymentType);
|
|
13
|
+
const handlePaymentMethodChangeSubmit = () => {
|
|
14
|
+
fillCheckoutData('paymentType', selectedPayment);
|
|
15
|
+
closePopup();
|
|
16
|
+
};
|
|
17
|
+
return (React.createElement(SelectPaymentMethodPopupStyle, null,
|
|
18
|
+
React.createElement("div", { className: `select-payment-wrap` },
|
|
19
|
+
React.createElement(Text, { tag: `h6`, className: 'account-p account-p2 account-font-bold account-primary-color1', text: 'selectPaymentMethod' })),
|
|
20
|
+
React.createElement(PaymentWrap, { selectedPayment: selectedPayment, setSelectedPayment: setSelectedPayment }),
|
|
21
|
+
React.createElement("div", { className: `cancel-and-save-wrap` },
|
|
22
|
+
React.createElement(AccountButton, { btnType: `green-large-text`, text: `cancel`, onClick: closePopup }),
|
|
23
|
+
React.createElement(AccountButton, { btnType: `full-width`, text: `saveAndApply`, onClick: handlePaymentMethodChangeSubmit }))));
|
|
24
|
+
};
|
|
25
|
+
export default SelectPaymentMethodPopup;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
const SelectPaymentMethodPopupStyle = styled.section `
|
|
3
|
+
--account_selectPaymentTitleMBot: var(--sp4x);
|
|
4
|
+
--account_cancelAndSaveWrapMTop: var(--sp5x);
|
|
5
|
+
--account_cancelDistance: var(--sp5x);
|
|
6
|
+
|
|
7
|
+
.cancel-and-save-wrap {
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: flex-end;
|
|
10
|
+
align-items: center;
|
|
11
|
+
margin-top: var(--account_cancelAndSaveWrapMTop);
|
|
12
|
+
|
|
13
|
+
.btn-wrap {
|
|
14
|
+
&:first-child {
|
|
15
|
+
margin-right: var(--account_cancelDistance);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.select-payment-wrap {
|
|
21
|
+
margin-bottom: var(--account_selectPaymentTitleMBot);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeL}) {
|
|
25
|
+
--account_selectPaymentTitleMBot: var(--sp4x);
|
|
26
|
+
--account_cancelAndSaveWrapMTop: var(--sp4x);
|
|
27
|
+
--account_cancelDistance: var(--sp3x);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeLMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeM}) {
|
|
31
|
+
--account_selectPaymentTitleMBot: var(--sp4x);
|
|
32
|
+
--account_cancelAndSaveWrapMTop: var(--sp3x);
|
|
33
|
+
--account_cancelDistance: var(--sp3x);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeMMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeS}) {
|
|
37
|
+
--account_selectPaymentTitleMBot: var(--sp4x);
|
|
38
|
+
--account_cancelAndSaveWrapMTop: var(--sp3x);
|
|
39
|
+
--account_cancelDistance: var(--sp3x);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXS}) {
|
|
43
|
+
--account_selectPaymentTitleMBot: var(--sp3x);
|
|
44
|
+
--account_cancelAndSaveWrapMTop: var(--sp3x);
|
|
45
|
+
--account_cancelDistance: var(--sp2-5x);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_DesktopSizeXSMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSize}) {
|
|
49
|
+
--account_selectPaymentTitleMBot: var(--sp2-5x);
|
|
50
|
+
--account_cancelAndSaveWrapMTop: var(--sp3x);
|
|
51
|
+
--account_cancelDistance: var(--sp2-5x);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeMin}) and (min-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeS}) {
|
|
55
|
+
--account_selectPaymentTitleMBot: var(--sp3x);
|
|
56
|
+
--account_cancelAndSaveWrapMTop: var(--sp3x);
|
|
57
|
+
--account_cancelDistance: var(--sp2-5x);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media only screen and (max-width: ${(props) => props.theme.account.mediaQuery.account_TabletSizeSMin}) {
|
|
61
|
+
--account_selectPaymentTitleMBot: var(--sp2x);
|
|
62
|
+
--account_cancelAndSaveWrapMTop: var(--sp3x);
|
|
63
|
+
--account_cancelDistance: var(--sp2x);
|
|
64
|
+
|
|
65
|
+
.cancel-and-save-wrap {
|
|
66
|
+
flex-direction: column-reverse;
|
|
67
|
+
|
|
68
|
+
.btn-wrap {
|
|
69
|
+
&:first-child {
|
|
70
|
+
margin-right: 0;
|
|
71
|
+
margin-top: var(--account_cancelDistance);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&:last-child {
|
|
75
|
+
width: 100%;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
export default SelectPaymentMethodPopupStyle;
|
|
@@ -37,6 +37,8 @@ declare const _default: {
|
|
|
37
37
|
accountSettings: string;
|
|
38
38
|
orderHistory: string;
|
|
39
39
|
signOut: string;
|
|
40
|
+
name: string;
|
|
41
|
+
namePlaceholder: string;
|
|
40
42
|
firstName: string;
|
|
41
43
|
first_name: string;
|
|
42
44
|
firstNamePlaceholder: string;
|
|
@@ -88,6 +90,7 @@ declare const _default: {
|
|
|
88
90
|
inProgress: string;
|
|
89
91
|
orderDetails: string;
|
|
90
92
|
deliverDate: string;
|
|
93
|
+
usedBalance: string;
|
|
91
94
|
sortBy: string;
|
|
92
95
|
sortByWithSymbol: string;
|
|
93
96
|
delivered: string;
|
package/dist/translations/en.js
CHANGED
|
@@ -37,6 +37,9 @@ export default {
|
|
|
37
37
|
accountSettings: 'Account settings',
|
|
38
38
|
orderHistory: 'Order history',
|
|
39
39
|
signOut: 'Sign out',
|
|
40
|
+
//! Name
|
|
41
|
+
name: 'Name',
|
|
42
|
+
namePlaceholder: 'Name',
|
|
40
43
|
//! First Name
|
|
41
44
|
firstName: 'First name',
|
|
42
45
|
first_name: 'First name:',
|
|
@@ -96,6 +99,7 @@ export default {
|
|
|
96
99
|
inProgress: 'In progress',
|
|
97
100
|
orderDetails: 'Order details',
|
|
98
101
|
deliverDate: 'Deliver date',
|
|
102
|
+
usedBalance: 'Used Balance',
|
|
99
103
|
sortBy: 'Sort by',
|
|
100
104
|
sortByWithSymbol: 'Sort by:',
|
|
101
105
|
delivered: 'Delivered',
|
|
@@ -37,6 +37,8 @@ declare const _default: {
|
|
|
37
37
|
accountSettings: string;
|
|
38
38
|
orderHistory: string;
|
|
39
39
|
signOut: string;
|
|
40
|
+
name: string;
|
|
41
|
+
namePlaceholder: string;
|
|
40
42
|
firstName: string;
|
|
41
43
|
first_name: string;
|
|
42
44
|
firstNamePlaceholder: string;
|
|
@@ -88,6 +90,7 @@ declare const _default: {
|
|
|
88
90
|
inProgress: string;
|
|
89
91
|
orderDetails: string;
|
|
90
92
|
deliverDate: string;
|
|
93
|
+
usedBalance: string;
|
|
91
94
|
sortBy: string;
|
|
92
95
|
sortByWithSymbol: string;
|
|
93
96
|
delivered: string;
|
package/dist/translations/hy.js
CHANGED
|
@@ -37,6 +37,9 @@ export default {
|
|
|
37
37
|
accountSettings: 'Account settings',
|
|
38
38
|
orderHistory: 'Order history',
|
|
39
39
|
signOut: 'Sign out',
|
|
40
|
+
//! Name
|
|
41
|
+
name: 'Name',
|
|
42
|
+
namePlaceholder: 'Name',
|
|
40
43
|
//! First Name
|
|
41
44
|
firstName: 'First name',
|
|
42
45
|
first_name: 'First name:',
|
|
@@ -96,6 +99,7 @@ export default {
|
|
|
96
99
|
inProgress: 'In progress',
|
|
97
100
|
orderDetails: 'Order details',
|
|
98
101
|
deliverDate: 'Deliver date',
|
|
102
|
+
usedBalance: 'Used Balance',
|
|
99
103
|
sortBy: 'Sort by',
|
|
100
104
|
sortByWithSymbol: 'Sort by:',
|
|
101
105
|
delivered: 'Delivered',
|
|
@@ -38,6 +38,8 @@ declare const _default: {
|
|
|
38
38
|
accountSettings: string;
|
|
39
39
|
orderHistory: string;
|
|
40
40
|
signOut: string;
|
|
41
|
+
name: string;
|
|
42
|
+
namePlaceholder: string;
|
|
41
43
|
firstName: string;
|
|
42
44
|
first_name: string;
|
|
43
45
|
firstNamePlaceholder: string;
|
|
@@ -89,6 +91,7 @@ declare const _default: {
|
|
|
89
91
|
inProgress: string;
|
|
90
92
|
orderDetails: string;
|
|
91
93
|
deliverDate: string;
|
|
94
|
+
usedBalance: string;
|
|
92
95
|
sortBy: string;
|
|
93
96
|
sortByWithSymbol: string;
|
|
94
97
|
delivered: string;
|
|
@@ -244,6 +247,8 @@ declare const _default: {
|
|
|
244
247
|
accountSettings: string;
|
|
245
248
|
orderHistory: string;
|
|
246
249
|
signOut: string;
|
|
250
|
+
name: string;
|
|
251
|
+
namePlaceholder: string;
|
|
247
252
|
firstName: string;
|
|
248
253
|
first_name: string;
|
|
249
254
|
firstNamePlaceholder: string;
|
|
@@ -295,6 +300,7 @@ declare const _default: {
|
|
|
295
300
|
inProgress: string;
|
|
296
301
|
orderDetails: string;
|
|
297
302
|
deliverDate: string;
|
|
303
|
+
usedBalance: string;
|
|
298
304
|
sortBy: string;
|
|
299
305
|
sortByWithSymbol: string;
|
|
300
306
|
delivered: string;
|
|
@@ -450,6 +456,8 @@ declare const _default: {
|
|
|
450
456
|
accountSettings: string;
|
|
451
457
|
orderHistory: string;
|
|
452
458
|
signOut: string;
|
|
459
|
+
name: string;
|
|
460
|
+
namePlaceholder: string;
|
|
453
461
|
firstName: string;
|
|
454
462
|
first_name: string;
|
|
455
463
|
firstNamePlaceholder: string;
|
|
@@ -501,6 +509,7 @@ declare const _default: {
|
|
|
501
509
|
inProgress: string;
|
|
502
510
|
orderDetails: string;
|
|
503
511
|
deliverDate: string;
|
|
512
|
+
usedBalance: string;
|
|
504
513
|
sortBy: string;
|
|
505
514
|
sortByWithSymbol: string;
|
|
506
515
|
delivered: string;
|
|
@@ -37,6 +37,8 @@ declare const _default: {
|
|
|
37
37
|
accountSettings: string;
|
|
38
38
|
orderHistory: string;
|
|
39
39
|
signOut: string;
|
|
40
|
+
name: string;
|
|
41
|
+
namePlaceholder: string;
|
|
40
42
|
firstName: string;
|
|
41
43
|
first_name: string;
|
|
42
44
|
firstNamePlaceholder: string;
|
|
@@ -88,6 +90,7 @@ declare const _default: {
|
|
|
88
90
|
inProgress: string;
|
|
89
91
|
orderDetails: string;
|
|
90
92
|
deliverDate: string;
|
|
93
|
+
usedBalance: string;
|
|
91
94
|
sortBy: string;
|
|
92
95
|
sortByWithSymbol: string;
|
|
93
96
|
delivered: string;
|
package/dist/translations/ru.js
CHANGED
|
@@ -37,6 +37,9 @@ export default {
|
|
|
37
37
|
accountSettings: 'Account settings',
|
|
38
38
|
orderHistory: 'Order history',
|
|
39
39
|
signOut: 'Sign out',
|
|
40
|
+
//! Name
|
|
41
|
+
name: 'Name',
|
|
42
|
+
namePlaceholder: 'Name',
|
|
40
43
|
//! First Name
|
|
41
44
|
firstName: 'First name',
|
|
42
45
|
first_name: 'First name:',
|
|
@@ -96,6 +99,7 @@ export default {
|
|
|
96
99
|
inProgress: 'In progress',
|
|
97
100
|
orderDetails: 'Order details',
|
|
98
101
|
deliverDate: 'Deliver date',
|
|
102
|
+
usedBalance: 'Used Balance',
|
|
99
103
|
sortBy: 'Sort by',
|
|
100
104
|
sortByWithSymbol: 'Sort by:',
|
|
101
105
|
delivered: 'Delivered',
|
package/package.json
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React, { memo as Memo, useEffect, useState } from 'react';
|
|
2
|
-
import { useUi, Text } from '@weareconceptstudio/core';
|
|
3
|
-
//* Components
|
|
4
|
-
import AccountButton from '../../AccountButton';
|
|
5
|
-
import PaymentMethodsComp from '../PaymentMethodsComp';
|
|
6
|
-
import AddNewCard from '../AddNewCard';
|
|
7
|
-
import CardComp from '../CardComp';
|
|
8
|
-
//* Style
|
|
9
|
-
import SelectPaymentMethodPopupStyle from './style';
|
|
10
|
-
import { useCheckoutContext } from '../../../modules';
|
|
11
|
-
import { useAccountContext } from '../../../AccountProvider';
|
|
12
|
-
const SelectPaymentMethodPopup = Memo(() => {
|
|
13
|
-
const { closePopup } = useUi();
|
|
14
|
-
const { useUser } = useAccountContext();
|
|
15
|
-
const { checkoutData, fillCheckoutData } = useCheckoutContext();
|
|
16
|
-
const [selectedPaymentType, setSelectedPaymentType] = useState(checkoutData.paymentType);
|
|
17
|
-
const [selectedCard, setSelectedCard] = useState('');
|
|
18
|
-
const { user } = useUser();
|
|
19
|
-
const handlePaymentMethodChangeSubmit = () => {
|
|
20
|
-
fillCheckoutData('paymentType', selectedPaymentType);
|
|
21
|
-
closePopup();
|
|
22
|
-
};
|
|
23
|
-
return (React.createElement(SelectPaymentMethodPopupStyle, null,
|
|
24
|
-
React.createElement("div", { className: `select-payment-wrap` },
|
|
25
|
-
React.createElement(Text, { tag: `h6`, className: 'account-p account-p2 account-font-bold account-primary-color1', text: 'selectPaymentMethod' })),
|
|
26
|
-
React.createElement("div", { className: `flex-wrapper` },
|
|
27
|
-
React.createElement(AddNewCard, { title: 'addNewCard' }),
|
|
28
|
-
user?.cards?.map((card, index) => (React.createElement(CardComp, { key: index, cardOption: card, selectedPayment: selectedCard, onSelect: setSelectedCard })))),
|
|
29
|
-
React.createElement("div", { className: 'line' }),
|
|
30
|
-
React.createElement(PaymentMethodsComp, { checkoutData: { ...checkoutData, paymentType: selectedPaymentType }, selectPayment: setSelectedPaymentType, selectedPayment: selectedPaymentType, showAll: true }),
|
|
31
|
-
React.createElement("div", { className: `cancel-and-save-wrap` },
|
|
32
|
-
React.createElement(AccountButton, { btnType: `green-large-text`, text: `cancel`, onClick: closePopup }),
|
|
33
|
-
React.createElement(AccountButton, { btnType: `full-width`, text: `saveAndApply`, onClick: handlePaymentMethodChangeSubmit }))));
|
|
34
|
-
});
|
|
35
|
-
export default SelectPaymentMethodPopup;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{components/TotalCheckout → modules/payment}/SelectPaymentMethodPopup/style.d.ts
RENAMED
|
File without changes
|