@thecb/components 5.8.2-beta.9 → 5.9.0-beta.2
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 +92 -1101
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +92 -1101
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/obligation/Obligation.js +10 -2
- package/src/components/molecules/obligation/modules/AutopayModalModule.js +10 -4
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +20 -13
- package/src/components/molecules/obligation/modules/InactiveTitleModule.js +2 -2
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +3 -1
- package/src/components/molecules/obligation/modules/RemoveAccountModalModule.js +62 -0
- package/src/components/molecules/obligation/modules/index.js +3 -1
- package/src/components/molecules/tab-sidebar/TabSidebar.js +3 -2
package/package.json
CHANGED
|
@@ -30,6 +30,8 @@ const Obligation = ({
|
|
|
30
30
|
isPaymentPlan,
|
|
31
31
|
nextAutopayDate,
|
|
32
32
|
obligationAssocID,
|
|
33
|
+
dueDate,
|
|
34
|
+
agencyName,
|
|
33
35
|
inactive = false,
|
|
34
36
|
inactiveLookupTitle = "",
|
|
35
37
|
inactiveLookupInput = "Account",
|
|
@@ -58,7 +60,7 @@ const Obligation = ({
|
|
|
58
60
|
border={`1px solid ${GRECIAN_GREY}`}
|
|
59
61
|
borderWidthOverride="1px 0 0 0"
|
|
60
62
|
>
|
|
61
|
-
<Box background={WHITE} padding="24px 16px">
|
|
63
|
+
<Box background={WHITE} padding={isMobile ? "16px" : "24px 16px"}>
|
|
62
64
|
<Stack childGap="14px">
|
|
63
65
|
<Box
|
|
64
66
|
key={`${firstObligation?.id}-top`}
|
|
@@ -157,7 +159,7 @@ const Obligation = ({
|
|
|
157
159
|
as="section"
|
|
158
160
|
aria-label={`${inactiveLookupTitle} ${inactiveLookupInput}: ${inactiveLookupValue}`}
|
|
159
161
|
>
|
|
160
|
-
<Box background={ATHENS_GREY} padding="24px">
|
|
162
|
+
<Box background={ATHENS_GREY} padding={isMobile ? "16px" : "24px"}>
|
|
161
163
|
<Stack childGap="14px">
|
|
162
164
|
<Box key={`${obligationAssocID}-top`} padding="0" minWidth="100%">
|
|
163
165
|
<Cluster
|
|
@@ -196,6 +198,9 @@ const Obligation = ({
|
|
|
196
198
|
isMobile={isMobile}
|
|
197
199
|
nextAutopayDate={nextAutopayDate}
|
|
198
200
|
obligationAssocID={obligationAssocID}
|
|
201
|
+
dueDate={dueDate}
|
|
202
|
+
agencyName={agencyName}
|
|
203
|
+
configType={config.type}
|
|
199
204
|
/>
|
|
200
205
|
)}
|
|
201
206
|
</Cluster>
|
|
@@ -212,6 +217,9 @@ const Obligation = ({
|
|
|
212
217
|
isMobile={isMobile}
|
|
213
218
|
nextAutopayDate={nextAutopayDate}
|
|
214
219
|
obligationAssocID={obligationAssocID}
|
|
220
|
+
dueDate={dueDate}
|
|
221
|
+
agencyName={agencyName}
|
|
222
|
+
configType={config.type}
|
|
215
223
|
/>
|
|
216
224
|
)}
|
|
217
225
|
</Stack>
|
|
@@ -7,7 +7,6 @@ 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";
|
|
11
10
|
|
|
12
11
|
const AutopayModal = ({
|
|
13
12
|
autoPayActive,
|
|
@@ -21,9 +20,12 @@ const AutopayModal = ({
|
|
|
21
20
|
isMobile,
|
|
22
21
|
themeValues,
|
|
23
22
|
isPaymentPlan,
|
|
24
|
-
nextAutopayDate
|
|
23
|
+
nextAutopayDate,
|
|
24
|
+
dueDate,
|
|
25
|
+
inactive
|
|
25
26
|
}) => {
|
|
26
27
|
const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
28
|
+
const nextDate = dueDate || nextAutopayDate;
|
|
27
29
|
const modalExtraProps = {
|
|
28
30
|
modalHeaderText: autoPayActive
|
|
29
31
|
? `Deactivate ${planType}`
|
|
@@ -31,7 +33,11 @@ const AutopayModal = ({
|
|
|
31
33
|
modalBodyText: autoPayActive
|
|
32
34
|
? `Are you sure you want to deactivate ${
|
|
33
35
|
isPaymentPlan ? "your payment plan" : "autopay"
|
|
34
|
-
}?
|
|
36
|
+
}? ${
|
|
37
|
+
!inactive && nextDate
|
|
38
|
+
? `Your next payment will be due on ${nextDate}.`
|
|
39
|
+
: ""
|
|
40
|
+
}`
|
|
35
41
|
: `To set up ${
|
|
36
42
|
isPaymentPlan ? "a payment plan" : "autopay"
|
|
37
43
|
} you must save a payment method and address in your profile. Do you want to save these now?`,
|
|
@@ -76,7 +82,7 @@ const AutopayModal = ({
|
|
|
76
82
|
dataQa="Turn off Autopay"
|
|
77
83
|
extraStyles={
|
|
78
84
|
isMobile
|
|
79
|
-
? `flex-grow: 1; width: 100
|
|
85
|
+
? `flex-grow: 1; width: 100%; margin: 0;`
|
|
80
86
|
: `flex-grow: 1; min-width: 165px;`
|
|
81
87
|
}
|
|
82
88
|
/>
|
|
@@ -3,6 +3,7 @@ import { GHOST_GREY } from "../../../../constants/colors";
|
|
|
3
3
|
import ButtonWithAction from "../../../atoms/button-with-action";
|
|
4
4
|
import { Box, Cluster } from "../../../atoms/layouts";
|
|
5
5
|
import { AutopayModalModule } from "./AutopayModalModule";
|
|
6
|
+
import RemoveAccountModalModule from "./RemoveAccountModalModule";
|
|
6
7
|
|
|
7
8
|
const InactiveControlsModule = ({
|
|
8
9
|
autoPayEnabled,
|
|
@@ -14,18 +15,27 @@ const InactiveControlsModule = ({
|
|
|
14
15
|
isPaymentPlan,
|
|
15
16
|
nextAutopayDate,
|
|
16
17
|
obligationAssocID,
|
|
18
|
+
dueDate,
|
|
19
|
+
agencyName,
|
|
20
|
+
configType,
|
|
17
21
|
actions
|
|
18
22
|
}) => {
|
|
23
|
+
console.log("actions are", actions);
|
|
19
24
|
const [modalOpen, toggleModal] = useState(false);
|
|
20
|
-
const {
|
|
21
|
-
const handleRemoveAccount = () =>
|
|
25
|
+
const { deleteObligationAssoc } = actions;
|
|
26
|
+
const handleRemoveAccount = () => deleteObligationAssoc(obligationAssocID);
|
|
22
27
|
return (
|
|
23
28
|
<Box
|
|
24
29
|
padding={isMobile ? "18px 0 0 0" : "0"}
|
|
25
30
|
border={isMobile ? `1px solid ${GHOST_GREY}` : `0px`}
|
|
26
31
|
borderWidthOverride={isMobile ? `1px 0 0 0` : `0px`}
|
|
27
32
|
>
|
|
28
|
-
<Cluster
|
|
33
|
+
<Cluster
|
|
34
|
+
childGap={autoPayEnabled ? `8px` : "0"}
|
|
35
|
+
nowrap
|
|
36
|
+
justify={isMobile && autoPayEnabled && "center"}
|
|
37
|
+
align={isMobile && autoPayEnabled && "center"}
|
|
38
|
+
>
|
|
29
39
|
{autoPayEnabled && (
|
|
30
40
|
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
31
41
|
<AutopayModalModule
|
|
@@ -40,21 +50,18 @@ const InactiveControlsModule = ({
|
|
|
40
50
|
isPaymentPlan={isPaymentPlan}
|
|
41
51
|
nextAutopayDate={nextAutopayDate}
|
|
42
52
|
obligationAssocID={obligationAssocID}
|
|
53
|
+
dueDate={dueDate}
|
|
43
54
|
controlType="secondary"
|
|
55
|
+
inactive
|
|
44
56
|
/>
|
|
45
57
|
</Box>
|
|
46
58
|
)}
|
|
47
59
|
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
extraStyles={
|
|
54
|
-
isMobile
|
|
55
|
-
? `flex-grow: 1; width: 100%; margin: 0;`
|
|
56
|
-
: `flex-grow: 1;`
|
|
57
|
-
}
|
|
60
|
+
<RemoveAccountModalModule
|
|
61
|
+
agencyName={agencyName}
|
|
62
|
+
removeAccount={handleRemoveAccount}
|
|
63
|
+
accountType={configType === "ACCOUNT" ? "Account" : "Property"}
|
|
64
|
+
isMobile={isMobile}
|
|
58
65
|
/>
|
|
59
66
|
</Box>
|
|
60
67
|
</Cluster>
|
|
@@ -28,9 +28,9 @@ const InactiveTitleModule = ({ title, subtitle, autoPayEnabled }) => (
|
|
|
28
28
|
Unable to load account details
|
|
29
29
|
</Detail>
|
|
30
30
|
<Detail variant="extraSmall" as="p" color={BLACK}>
|
|
31
|
-
{`This may mean that the
|
|
31
|
+
{`This may mean that the balance has been paid, or there was an error loading it.${
|
|
32
32
|
autoPayEnabled
|
|
33
|
-
? " You may disable
|
|
33
|
+
? " You may disable autopay for this account by pressing the 'Turn off Autopay' button."
|
|
34
34
|
: ""
|
|
35
35
|
}`}
|
|
36
36
|
</Detail>
|
|
@@ -19,7 +19,8 @@ const PaymentDetailsActions = ({
|
|
|
19
19
|
paymentPlanSchedule,
|
|
20
20
|
isPaymentPlan,
|
|
21
21
|
nextAutopayDate,
|
|
22
|
-
obligationAssocID
|
|
22
|
+
obligationAssocID,
|
|
23
|
+
dueDate
|
|
23
24
|
}) => {
|
|
24
25
|
const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
25
26
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -126,6 +127,7 @@ const PaymentDetailsActions = ({
|
|
|
126
127
|
paymentPlanSchedule={paymentPlanSchedule}
|
|
127
128
|
isPaymentPlan={isPaymentPlan}
|
|
128
129
|
nextAutopayDate={nextAutopayDate}
|
|
130
|
+
dueDate={dueDate}
|
|
129
131
|
/>
|
|
130
132
|
)}
|
|
131
133
|
</Box>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import Modal from "../../modal";
|
|
3
|
+
import ButtonWithAction from "../../../atoms/button-with-action";
|
|
4
|
+
import { Box } from "../../../atoms/layouts";
|
|
5
|
+
|
|
6
|
+
const RemoveAccountModalModule = ({
|
|
7
|
+
agencyName,
|
|
8
|
+
obligations = [],
|
|
9
|
+
removeAccount,
|
|
10
|
+
accountType,
|
|
11
|
+
isMobile
|
|
12
|
+
}) => {
|
|
13
|
+
const [modalIsOpen, setModalIsOpen] = useState(false);
|
|
14
|
+
const lastItem = [...obligations].pop();
|
|
15
|
+
const accounts = obligations.length
|
|
16
|
+
? obligations.reduce((acc, curr) => {
|
|
17
|
+
const account = curr.details.description;
|
|
18
|
+
const formattedAccount =
|
|
19
|
+
curr !== lastItem ? `${account} and ` : `${account}`;
|
|
20
|
+
return formattedAccount === agencyName
|
|
21
|
+
? agencyName
|
|
22
|
+
: acc + formattedAccount;
|
|
23
|
+
}, `${agencyName} - `)
|
|
24
|
+
: "";
|
|
25
|
+
const identifier =
|
|
26
|
+
accountType === "Account" && obligations.length > 1
|
|
27
|
+
? "accounts"
|
|
28
|
+
: accountType === "Property" && obligations.length > 1
|
|
29
|
+
? "properties"
|
|
30
|
+
: accountType.toLowerCase();
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Modal
|
|
34
|
+
showModal={() => setModalIsOpen(true)}
|
|
35
|
+
hideModal={() => setModalIsOpen(false)}
|
|
36
|
+
modalOpen={modalIsOpen}
|
|
37
|
+
modalHeaderText={`Remove ${accountType}`}
|
|
38
|
+
modalBodyText={`Are you sure you want to remove the ${identifier} ${accounts} from your profile? Any autopay scheduled against ${
|
|
39
|
+
obligations.length > 1 ? "them" : "it"
|
|
40
|
+
} will be deactivated.`}
|
|
41
|
+
continueButtonText="Remove"
|
|
42
|
+
continueAction={() => {
|
|
43
|
+
removeAccount();
|
|
44
|
+
setModalIsOpen(false);
|
|
45
|
+
}}
|
|
46
|
+
useDangerButton
|
|
47
|
+
>
|
|
48
|
+
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
49
|
+
<ButtonWithAction
|
|
50
|
+
text="Remove"
|
|
51
|
+
variant="secondary"
|
|
52
|
+
action={() => setModalIsOpen(true)}
|
|
53
|
+
dataQa="Remove Account"
|
|
54
|
+
extraStyles={
|
|
55
|
+
isMobile ? `flex-grow: 1; width: 100%; margin: 0;` : `flex-grow: 1;`
|
|
56
|
+
}
|
|
57
|
+
/>
|
|
58
|
+
</Box>
|
|
59
|
+
</Modal>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
export default RemoveAccountModalModule;
|
|
@@ -4,6 +4,7 @@ import AmountModule from "./AmountModule";
|
|
|
4
4
|
import PaymentDetailsActions from "./PaymentDetailsActions";
|
|
5
5
|
import InactiveControlsModule from "./InactiveControlsModule";
|
|
6
6
|
import InactiveTitleModule from "./InactiveTitleModule";
|
|
7
|
+
import RemoveAccountModalModule from "./RemoveAccountModalModule";
|
|
7
8
|
|
|
8
9
|
export {
|
|
9
10
|
IconModule,
|
|
@@ -11,5 +12,6 @@ export {
|
|
|
11
12
|
AmountModule,
|
|
12
13
|
PaymentDetailsActions,
|
|
13
14
|
InactiveControlsModule,
|
|
14
|
-
InactiveTitleModule
|
|
15
|
+
InactiveTitleModule,
|
|
16
|
+
RemoveAccountModalModule
|
|
15
17
|
};
|
|
@@ -4,7 +4,8 @@ import {
|
|
|
4
4
|
BRIGHT_GREY,
|
|
5
5
|
GHOST_GREY,
|
|
6
6
|
ATHENS_GREY,
|
|
7
|
-
TRANSPARENT
|
|
7
|
+
TRANSPARENT,
|
|
8
|
+
COOL_GREY_05
|
|
8
9
|
} from "../../../constants/colors";
|
|
9
10
|
import Text from "../../atoms/text";
|
|
10
11
|
import { InternalLink } from "../../atoms/link";
|
|
@@ -18,7 +19,7 @@ import { fallbackValues } from "./TabSidebar.theme";
|
|
|
18
19
|
const TabSidebar = ({ links, isMobile, themeValues }) => (
|
|
19
20
|
<Box
|
|
20
21
|
padding="0"
|
|
21
|
-
background={
|
|
22
|
+
background={COOL_GREY_05}
|
|
22
23
|
minHeight="100%"
|
|
23
24
|
role="region"
|
|
24
25
|
aria-label="Profile tabs"
|