@thecb/components 5.8.1-beta.0 → 5.8.1-beta.1
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/index.cjs.js +1154 -42
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1154 -42
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/obligation/modules/AmountModule.js +1 -0
- package/src/components/molecules/obligation/modules/AutopayModalModule.js +43 -21
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +2 -1
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +1 -1
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import { Box, Cluster } from "../../../atoms/layouts";
|
|
|
7
7
|
import { SEA_GREEN } from "../../../../constants/colors";
|
|
8
8
|
import { fallbackValues } from "./AutopayModalModule.theme";
|
|
9
9
|
import { themeComponent } from "../../../../util/themeUtils";
|
|
10
|
+
import { render } from "react-dom/cjs/react-dom.production.min";
|
|
10
11
|
|
|
11
12
|
const AutopayModal = ({
|
|
12
13
|
autoPayActive,
|
|
@@ -16,7 +17,7 @@ const AutopayModal = ({
|
|
|
16
17
|
modalOpen,
|
|
17
18
|
deactivatePaymentSchedule,
|
|
18
19
|
navigateToSettings,
|
|
19
|
-
|
|
20
|
+
controlType = "tertiary",
|
|
20
21
|
isMobile,
|
|
21
22
|
themeValues,
|
|
22
23
|
isPaymentPlan,
|
|
@@ -62,24 +63,35 @@ const AutopayModal = ({
|
|
|
62
63
|
const defaultStyles = `
|
|
63
64
|
.autopayIcon { fill: ${themeValues.color}; text-decoration: underline; }
|
|
64
65
|
`;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
66
|
+
const renderAutoPayControl = () => {
|
|
67
|
+
switch (controlType) {
|
|
68
|
+
case "secondary": {
|
|
69
|
+
return (
|
|
70
|
+
<ButtonWithAction
|
|
71
|
+
text={autoPayActive ? `Turn off ${planType}` : `Set Up ${planType}`}
|
|
72
|
+
variant="secondary"
|
|
73
|
+
action={() => {
|
|
74
|
+
toggleModal(true);
|
|
75
|
+
}}
|
|
76
|
+
dataQa="Turn off Autopay"
|
|
77
|
+
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
case "tertiary": {
|
|
82
|
+
return (
|
|
83
|
+
<ButtonWithAction
|
|
84
|
+
text={autoPayActive ? `Manage ${planType}` : `Set Up ${planType}`}
|
|
85
|
+
variant="tertiary"
|
|
86
|
+
action={() => {
|
|
87
|
+
toggleModal(true);
|
|
88
|
+
}}
|
|
89
|
+
dataQa="Manage Autopay"
|
|
90
|
+
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
case "link": {
|
|
83
95
|
<Box
|
|
84
96
|
padding="0"
|
|
85
97
|
onClick={() => {
|
|
@@ -111,8 +123,18 @@ const AutopayModal = ({
|
|
|
111
123
|
{`${planType} ${nextAutopayDate}`}
|
|
112
124
|
</Text>
|
|
113
125
|
</Cluster>
|
|
114
|
-
</Box
|
|
115
|
-
|
|
126
|
+
</Box>;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
return (
|
|
131
|
+
<Modal
|
|
132
|
+
showModal={() => toggleModal(true)}
|
|
133
|
+
hideModal={() => toggleModal(false)}
|
|
134
|
+
modalOpen={modalOpen}
|
|
135
|
+
{...modalExtraProps}
|
|
136
|
+
>
|
|
137
|
+
{renderAutoPayControl()}
|
|
116
138
|
</Modal>
|
|
117
139
|
);
|
|
118
140
|
};
|
|
@@ -40,12 +40,13 @@ const InactiveControlsModule = ({
|
|
|
40
40
|
isPaymentPlan={isPaymentPlan}
|
|
41
41
|
nextAutopayDate={nextAutopayDate}
|
|
42
42
|
obligationAssocID={obligationAssocID}
|
|
43
|
+
controlType="secondary"
|
|
43
44
|
/>
|
|
44
45
|
</Box>
|
|
45
46
|
)}
|
|
46
47
|
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
47
48
|
<ButtonWithAction
|
|
48
|
-
variant="
|
|
49
|
+
variant="secondary"
|
|
49
50
|
text="Remove"
|
|
50
51
|
action={handleRemoveAccount}
|
|
51
52
|
dataQa="Remove Account"
|
|
@@ -120,7 +120,7 @@ const PaymentDetailsActions = ({
|
|
|
120
120
|
modalOpen={modalOpen}
|
|
121
121
|
navigateToSettings={navigateToSettings}
|
|
122
122
|
deactivatePaymentSchedule={deactivatePaymentSchedule}
|
|
123
|
-
|
|
123
|
+
controlType="tertiary"
|
|
124
124
|
isMobile={isMobile}
|
|
125
125
|
paymentPlanSchedule={paymentPlanSchedule}
|
|
126
126
|
isPaymentPlan={isPaymentPlan}
|