@thecb/components 7.7.0-beta.0 → 7.7.0-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 +248 -190
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +248 -190
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/{components/.DS_Store → .DS_Store} +0 -0
- package/src/components/{molecules → atoms}/.DS_Store +0 -0
- package/src/components/atoms/{icons/PaymentIcon.js → formatted-bank-account/FormattedBankAccount.js} +22 -8
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.theme.js +9 -0
- package/src/components/atoms/formatted-bank-account/index.js +3 -0
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.js +32 -60
- package/src/components/atoms/icons/{ExternalLinkIcon.js → ExternalLinkicon.js} +0 -0
- package/src/components/atoms/icons/index.js +0 -2
- package/src/components/atoms/index.js +1 -0
- package/src/components/molecules/obligation/Obligation.js +25 -5
- package/src/components/molecules/obligation/modules/AmountModule.js +7 -1
- package/src/components/molecules/obligation/modules/AutopayModalModule.js +33 -15
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +7 -1
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +10 -1
- package/src/components/molecules/radio-group/RadioGroup.js +4 -1
- package/src/components/molecules/radio-section/RadioSection.js +9 -50
- package/src/constants/general.js +3 -0
- package/src/util/general.js +62 -1
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
package/src/components/atoms/{icons/PaymentIcon.js → formatted-bank-account/FormattedBankAccount.js}
RENAMED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import styled from "styled-components";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
3
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
4
|
+
import { fallbackValues } from "./FormattedBankAccount.theme";
|
|
5
|
+
import BankIcon from "../icons/BankIcon";
|
|
5
6
|
import { Stack, Box } from "../layouts";
|
|
6
7
|
import Text from "../text";
|
|
7
8
|
|
|
@@ -12,7 +13,7 @@ export const BankItemWrapper = styled.div`
|
|
|
12
13
|
`;
|
|
13
14
|
|
|
14
15
|
export const BankAccountText = styled.h4`
|
|
15
|
-
color: ${
|
|
16
|
+
color: ${({ color }) => color};
|
|
16
17
|
font-size: 1rem;
|
|
17
18
|
font-weight: 400;
|
|
18
19
|
line-height: 1.5rem;
|
|
@@ -24,22 +25,31 @@ export const BankAccountText = styled.h4`
|
|
|
24
25
|
const CHECKING = "CHECKING";
|
|
25
26
|
const SAVINGS = "SAVINGS";
|
|
26
27
|
|
|
27
|
-
const
|
|
28
|
+
const FormattedBankAccount = ({
|
|
29
|
+
lastFour,
|
|
30
|
+
accountType,
|
|
31
|
+
autoPay,
|
|
32
|
+
themeValues
|
|
33
|
+
}) => (
|
|
28
34
|
<BankItemWrapper>
|
|
29
35
|
<Box padding="0.25rem 0 0 0" extraStyles={`margin-right: 1rem;`}>
|
|
30
36
|
<BankIcon />
|
|
31
37
|
</Box>
|
|
32
38
|
<Stack childGap="0">
|
|
33
39
|
{accountType === CHECKING && (
|
|
34
|
-
<BankAccountText
|
|
40
|
+
<BankAccountText color={themeValues.textColor}>
|
|
41
|
+
Checking Account ending in {lastFour}
|
|
42
|
+
</BankAccountText>
|
|
35
43
|
)}
|
|
36
44
|
{accountType === SAVINGS && (
|
|
37
|
-
<BankAccountText
|
|
45
|
+
<BankAccountText color={themeValues.textColor}>
|
|
46
|
+
Savings Account ending in {lastFour}
|
|
47
|
+
</BankAccountText>
|
|
38
48
|
)}
|
|
39
49
|
{autoPay && (
|
|
40
50
|
<Text
|
|
41
51
|
variant="p"
|
|
42
|
-
color={
|
|
52
|
+
color={themeValues.autopayTextColor}
|
|
43
53
|
extraStyles={`font-style: italic;`}
|
|
44
54
|
>{`Autopay Enabled`}</Text>
|
|
45
55
|
)}
|
|
@@ -47,4 +57,8 @@ const PaymentIcon = ({ lastFour, accountType, autoPay }) => (
|
|
|
47
57
|
</BankItemWrapper>
|
|
48
58
|
);
|
|
49
59
|
|
|
50
|
-
export default
|
|
60
|
+
export default themeComponent(
|
|
61
|
+
FormattedBankAccount,
|
|
62
|
+
"FormattedBankAccount",
|
|
63
|
+
fallbackValues
|
|
64
|
+
);
|
|
@@ -2,15 +2,10 @@ import React, { Fragment } from "react";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import GenericCard from "../icons/GenericCard";
|
|
4
4
|
import Text from "../text";
|
|
5
|
-
import Paragraph from "../paragraph";
|
|
6
5
|
import { Box, Stack } from "../layouts";
|
|
7
6
|
import { fallbackValues } from "./FormattedCreditCard.theme";
|
|
8
7
|
import { themeComponent } from "../../../util/themeUtils";
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const ACTIVE = "ACTIVE";
|
|
12
|
-
const EXPIRING_SOON = "EXPIRING_SOON";
|
|
13
|
-
const EXPIRED = "EXPIRED";
|
|
8
|
+
import { renderCardStatus } from "../../../util/general";
|
|
14
9
|
|
|
15
10
|
export const CreditCardWrapper = styled.div`
|
|
16
11
|
display: flex;
|
|
@@ -31,61 +26,38 @@ const FormattedCreditCard = ({
|
|
|
31
26
|
expireDate,
|
|
32
27
|
expirationStatus,
|
|
33
28
|
themeValues
|
|
34
|
-
}) =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
</
|
|
54
|
-
);
|
|
55
|
-
default:
|
|
56
|
-
null;
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
return (
|
|
60
|
-
<CreditCardWrapper>
|
|
61
|
-
<CCIconWrapper>
|
|
62
|
-
<GenericCard />
|
|
63
|
-
</CCIconWrapper>
|
|
64
|
-
<Stack childGap="0">
|
|
65
|
-
<Box padding="0">
|
|
66
|
-
<Text
|
|
67
|
-
variant="p"
|
|
68
|
-
padding="0 0 0 8px"
|
|
69
|
-
color={themeValues.textColor}
|
|
70
|
-
textAlign="left"
|
|
71
|
-
extraStyles={`display: inline-block;`}
|
|
72
|
-
>
|
|
73
|
-
{`Card ending in ${lastFour}`}
|
|
74
|
-
</Text>
|
|
75
|
-
{expireDate && <Fragment>{renderCardStatus()}</Fragment>}
|
|
76
|
-
</Box>
|
|
77
|
-
{autoPay && (
|
|
78
|
-
<Text
|
|
79
|
-
variant="p"
|
|
80
|
-
color={themeValues.autopayTextColor}
|
|
81
|
-
extraStyles={`font-style: italic;`}
|
|
82
|
-
>{`Autopay Enabled`}</Text>
|
|
29
|
+
}) => (
|
|
30
|
+
<CreditCardWrapper>
|
|
31
|
+
<CCIconWrapper>
|
|
32
|
+
<GenericCard />
|
|
33
|
+
</CCIconWrapper>
|
|
34
|
+
<Stack childGap="0">
|
|
35
|
+
<Box padding="0">
|
|
36
|
+
<Text
|
|
37
|
+
variant="p"
|
|
38
|
+
padding="0 0 0 8px"
|
|
39
|
+
color={themeValues.textColor}
|
|
40
|
+
textAlign="left"
|
|
41
|
+
extraStyles={`display: inline-block;`}
|
|
42
|
+
>
|
|
43
|
+
{`Card ending in ${lastFour}`}
|
|
44
|
+
</Text>
|
|
45
|
+
{expireDate && (
|
|
46
|
+
<Fragment>
|
|
47
|
+
{renderCardStatus(expirationStatus, expireDate, "left", "p")}
|
|
48
|
+
</Fragment>
|
|
83
49
|
)}
|
|
84
|
-
</
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
50
|
+
</Box>
|
|
51
|
+
{autoPay && (
|
|
52
|
+
<Text
|
|
53
|
+
variant="p"
|
|
54
|
+
color={themeValues.autopayTextColor}
|
|
55
|
+
extraStyles={`font-style: italic;`}
|
|
56
|
+
>{`Autopay Enabled`}</Text>
|
|
57
|
+
)}
|
|
58
|
+
</Stack>
|
|
59
|
+
</CreditCardWrapper>
|
|
60
|
+
);
|
|
89
61
|
export default themeComponent(
|
|
90
62
|
FormattedCreditCard,
|
|
91
63
|
"FormattedCreditCard",
|
|
File without changes
|
|
@@ -18,7 +18,6 @@ import RoutingNumberImage from "./RoutingNumberImage";
|
|
|
18
18
|
import CheckmarkIcon from "./CheckmarkIcon";
|
|
19
19
|
import BankIcon from "./BankIcon";
|
|
20
20
|
import GenericCard from "./GenericCard";
|
|
21
|
-
import PaymentIcon from "./PaymentIcon";
|
|
22
21
|
import IconAdd from "./IconAdd";
|
|
23
22
|
import IconQuitLarge from "./IconQuitLarge";
|
|
24
23
|
import TimeoutImage from "./TimeoutImage";
|
|
@@ -85,7 +84,6 @@ export {
|
|
|
85
84
|
CheckmarkIcon,
|
|
86
85
|
BankIcon,
|
|
87
86
|
GenericCard,
|
|
88
|
-
PaymentIcon,
|
|
89
87
|
IconAdd,
|
|
90
88
|
IconQuitLarge,
|
|
91
89
|
TimeoutImage,
|
|
@@ -16,6 +16,7 @@ export { default as Dropdown } from "./dropdown";
|
|
|
16
16
|
export * from "./form-layouts";
|
|
17
17
|
export { default as FormSelect } from "./form-select";
|
|
18
18
|
export { default as FormattedAddress } from "./formatted-address";
|
|
19
|
+
export { default as FormattedBankAccount } from "./formatted-bank-account";
|
|
19
20
|
export { default as FormattedCreditCard } from "./formatted-credit-card";
|
|
20
21
|
export { default as HamburgerButton } from "./hamburger-button";
|
|
21
22
|
export { default as Heading } from "./heading";
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
ATHENS_GREY,
|
|
7
7
|
GRECIAN_GREY
|
|
8
8
|
} from "../../../constants/colors";
|
|
9
|
+
import { ACH_METHOD, CC_METHOD, CASH_METHOD } from "../../../constants/general";
|
|
9
10
|
import {
|
|
10
11
|
IconModule,
|
|
11
12
|
TitleModule,
|
|
@@ -45,7 +46,12 @@ const Obligation = ({
|
|
|
45
46
|
The top level desc/subdesc for all obligations in a collection is the same
|
|
46
47
|
(Collection accounts look different in the Account Details page)
|
|
47
48
|
*/
|
|
48
|
-
const firstObligation = obligations[0];
|
|
49
|
+
const firstObligation = obligations?.[0] ?? {};
|
|
50
|
+
const {
|
|
51
|
+
allowedPaymentInstruments = [CASH_METHOD, CC_METHOD, ACH_METHOD],
|
|
52
|
+
description = "Account",
|
|
53
|
+
subDescription = obligationAssocID
|
|
54
|
+
} = firstObligation;
|
|
49
55
|
const customAttributes = firstObligation?.customAttributes ?? {};
|
|
50
56
|
const boxShadowValue =
|
|
51
57
|
"0px 2px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
|
|
@@ -55,8 +61,7 @@ const Obligation = ({
|
|
|
55
61
|
borderRadius="4px"
|
|
56
62
|
boxShadow={boxShadowValue}
|
|
57
63
|
as="section"
|
|
58
|
-
aria-label={`${
|
|
59
|
-
"account"} ${firstObligation?.subDescription ?? obligationAssocID}`}
|
|
64
|
+
aria-label={`${description} - ${subDescription}`}
|
|
60
65
|
border={`1px solid ${GRECIAN_GREY}`}
|
|
61
66
|
borderWidthOverride="1px 0 0 0"
|
|
62
67
|
>
|
|
@@ -85,8 +90,8 @@ const Obligation = ({
|
|
|
85
90
|
/>
|
|
86
91
|
)}
|
|
87
92
|
<TitleModule
|
|
88
|
-
title={
|
|
89
|
-
subtitle={
|
|
93
|
+
title={description}
|
|
94
|
+
subtitle={subDescription}
|
|
90
95
|
titleColor={BRIGHT_GREY}
|
|
91
96
|
isMobile={isMobile}
|
|
92
97
|
/>
|
|
@@ -106,6 +111,9 @@ const Obligation = ({
|
|
|
106
111
|
paymentPlanSchedule={paymentPlanSchedule}
|
|
107
112
|
isPaymentPlan={isPaymentPlan}
|
|
108
113
|
nextAutopayDate={nextAutopayDate}
|
|
114
|
+
description={description}
|
|
115
|
+
subDescription={subDescription}
|
|
116
|
+
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
109
117
|
/>
|
|
110
118
|
)}
|
|
111
119
|
</Cluster>
|
|
@@ -126,6 +134,9 @@ const Obligation = ({
|
|
|
126
134
|
isPaymentPlan={isPaymentPlan}
|
|
127
135
|
nextAutopayDate={nextAutopayDate}
|
|
128
136
|
obligationAssocID={obligationAssocID}
|
|
137
|
+
description={description}
|
|
138
|
+
subDescription={subDescription}
|
|
139
|
+
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
129
140
|
/>
|
|
130
141
|
)}
|
|
131
142
|
</Stack>
|
|
@@ -146,6 +157,9 @@ const Obligation = ({
|
|
|
146
157
|
isPaymentPlan={isPaymentPlan}
|
|
147
158
|
nextAutopayDate={nextAutopayDate}
|
|
148
159
|
obligationAssocID={obligationAssocID}
|
|
160
|
+
description={description}
|
|
161
|
+
subDescription={subDescription}
|
|
162
|
+
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
149
163
|
/>
|
|
150
164
|
)}
|
|
151
165
|
</Box>
|
|
@@ -201,6 +215,9 @@ const Obligation = ({
|
|
|
201
215
|
dueDate={dueDate}
|
|
202
216
|
agencyName={agencyName}
|
|
203
217
|
configType={config.type}
|
|
218
|
+
description={description}
|
|
219
|
+
subDescription={subDescription}
|
|
220
|
+
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
204
221
|
/>
|
|
205
222
|
)}
|
|
206
223
|
</Cluster>
|
|
@@ -220,6 +237,9 @@ const Obligation = ({
|
|
|
220
237
|
dueDate={dueDate}
|
|
221
238
|
agencyName={agencyName}
|
|
222
239
|
configType={config.type}
|
|
240
|
+
description={description}
|
|
241
|
+
subDescription={subDescription}
|
|
242
|
+
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
223
243
|
/>
|
|
224
244
|
)}
|
|
225
245
|
</Stack>
|
|
@@ -15,7 +15,10 @@ const AmountModule = ({
|
|
|
15
15
|
autoPaySchedule,
|
|
16
16
|
paymentPlanSchedule,
|
|
17
17
|
isPaymentPlan,
|
|
18
|
-
nextAutopayDate
|
|
18
|
+
nextAutopayDate,
|
|
19
|
+
description,
|
|
20
|
+
subDescription,
|
|
21
|
+
allowedPaymentInstruments
|
|
19
22
|
}) => {
|
|
20
23
|
const [modalOpen, toggleModal] = useState(false);
|
|
21
24
|
return (
|
|
@@ -43,6 +46,9 @@ const AmountModule = ({
|
|
|
43
46
|
isPaymentPlan={isPaymentPlan}
|
|
44
47
|
nextAutopayDate={nextAutopayDate}
|
|
45
48
|
controlType="link"
|
|
49
|
+
description={description}
|
|
50
|
+
subDescription={subDescription}
|
|
51
|
+
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
46
52
|
/>
|
|
47
53
|
)}
|
|
48
54
|
</Stack>
|
|
@@ -5,8 +5,10 @@ import Text from "../../../atoms/text";
|
|
|
5
5
|
import { AutopayOnIcon } from "../../../atoms/icons";
|
|
6
6
|
import { Box, Cluster } from "../../../atoms/layouts";
|
|
7
7
|
import { SEA_GREEN } from "../../../../constants/colors";
|
|
8
|
+
import { ACH_METHOD, CC_METHOD } from "../../../../constants/general";
|
|
8
9
|
import { fallbackValues } from "./AutopayModalModule.theme";
|
|
9
10
|
import { themeComponent } from "../../../../util/themeUtils";
|
|
11
|
+
import { titleCaseString } from "../../../../util/general";
|
|
10
12
|
|
|
11
13
|
const AutopayModal = ({
|
|
12
14
|
autoPayActive,
|
|
@@ -22,27 +24,41 @@ const AutopayModal = ({
|
|
|
22
24
|
isPaymentPlan,
|
|
23
25
|
nextAutopayDate,
|
|
24
26
|
dueDate,
|
|
25
|
-
inactive
|
|
27
|
+
inactive,
|
|
28
|
+
description,
|
|
29
|
+
subDescription,
|
|
30
|
+
allowedPaymentInstruments
|
|
26
31
|
}) => {
|
|
27
|
-
const
|
|
32
|
+
const generateMethodNeededText = (planText, allowedPaymentInstruments) => {
|
|
33
|
+
const allowsCard = allowedPaymentInstruments.includes(CC_METHOD);
|
|
34
|
+
const allowsACH = allowedPaymentInstruments.includes(ACH_METHOD);
|
|
35
|
+
const methodRequired =
|
|
36
|
+
allowsCard && !allowsACH
|
|
37
|
+
? "debit or credit card payment method"
|
|
38
|
+
: !allowsCard && allowsACH
|
|
39
|
+
? "checking account payment method"
|
|
40
|
+
: "payment method";
|
|
41
|
+
|
|
42
|
+
return `To setup ${planText} you must have a saved ${methodRequired} and address in your profile. Do you want to save these now?`;
|
|
43
|
+
};
|
|
44
|
+
const plan = isPaymentPlan ? "your payment plan" : "autopay";
|
|
45
|
+
const shortPlan = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
46
|
+
const deactivateText = `deactivate ${shortPlan} for ${description}: ${subDescription}`;
|
|
47
|
+
const activateText = `Set Up ${shortPlan} for ${description}: ${subDescription}`;
|
|
28
48
|
const nextDate = dueDate || nextAutopayDate;
|
|
29
49
|
const modalExtraProps = {
|
|
30
50
|
modalHeaderText: autoPayActive
|
|
31
|
-
?
|
|
32
|
-
:
|
|
51
|
+
? titleCaseString(deactivateText)
|
|
52
|
+
: titleCaseString(activateText),
|
|
33
53
|
modalBodyText: autoPayActive
|
|
34
|
-
? `Are you sure you want to deactivate ${
|
|
35
|
-
isPaymentPlan ? "your payment plan" : "autopay"
|
|
36
|
-
}? ${
|
|
54
|
+
? `Are you sure you want to deactivate ${plan}? ${
|
|
37
55
|
!inactive && nextDate
|
|
38
56
|
? `Your next payment will be due on ${nextDate}.`
|
|
39
57
|
: ""
|
|
40
58
|
}`
|
|
41
|
-
:
|
|
42
|
-
isPaymentPlan ? "a payment plan" : "autopay"
|
|
43
|
-
} you must save a payment method and address in your profile. Do you want to save these now?`,
|
|
59
|
+
: generateMethodNeededText(plan, allowedPaymentInstruments),
|
|
44
60
|
continueButtonText: autoPayActive
|
|
45
|
-
? `Disable ${
|
|
61
|
+
? `Disable ${shortPlan}`
|
|
46
62
|
: "Add to Profile",
|
|
47
63
|
useDangerButton: autoPayActive,
|
|
48
64
|
continueAction: autoPayActive
|
|
@@ -74,7 +90,9 @@ const AutopayModal = ({
|
|
|
74
90
|
case "secondary": {
|
|
75
91
|
return (
|
|
76
92
|
<ButtonWithAction
|
|
77
|
-
text={
|
|
93
|
+
text={
|
|
94
|
+
autoPayActive ? `Turn off ${shortPlan}` : `Set Up ${shortPlan}`
|
|
95
|
+
}
|
|
78
96
|
variant="secondary"
|
|
79
97
|
action={() => {
|
|
80
98
|
toggleModal(true);
|
|
@@ -91,7 +109,7 @@ const AutopayModal = ({
|
|
|
91
109
|
case "tertiary": {
|
|
92
110
|
return (
|
|
93
111
|
<ButtonWithAction
|
|
94
|
-
text={autoPayActive ? `Manage ${
|
|
112
|
+
text={autoPayActive ? `Manage ${shortPlan}` : `Set Up ${shortPlan}`}
|
|
95
113
|
variant="tertiary"
|
|
96
114
|
action={() => {
|
|
97
115
|
toggleModal(true);
|
|
@@ -124,13 +142,13 @@ const AutopayModal = ({
|
|
|
124
142
|
e.key === "Enter" && toggleModal(true);
|
|
125
143
|
}}
|
|
126
144
|
tabIndex="0"
|
|
127
|
-
dataQa={`${
|
|
145
|
+
dataQa={`${shortPlan} On`}
|
|
128
146
|
color={SEA_GREEN}
|
|
129
147
|
weight={themeValues.fontWeight}
|
|
130
148
|
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
131
149
|
extraStyles={`padding-left: 0.25rem;`}
|
|
132
150
|
>
|
|
133
|
-
{`${
|
|
151
|
+
{`${shortPlan} ${nextAutopayDate}`}
|
|
134
152
|
</Text>
|
|
135
153
|
</Cluster>
|
|
136
154
|
</Box>
|
|
@@ -18,7 +18,10 @@ const InactiveControlsModule = ({
|
|
|
18
18
|
dueDate,
|
|
19
19
|
agencyName,
|
|
20
20
|
configType,
|
|
21
|
-
actions
|
|
21
|
+
actions,
|
|
22
|
+
description,
|
|
23
|
+
subDescription,
|
|
24
|
+
allowedPaymentInstruments
|
|
22
25
|
}) => {
|
|
23
26
|
const [modalOpen, toggleModal] = useState(false);
|
|
24
27
|
const { deleteObligationAssoc } = actions;
|
|
@@ -52,6 +55,9 @@ const InactiveControlsModule = ({
|
|
|
52
55
|
dueDate={dueDate}
|
|
53
56
|
controlType="secondary"
|
|
54
57
|
inactive
|
|
58
|
+
description={description}
|
|
59
|
+
subDescription={subDescription}
|
|
60
|
+
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
55
61
|
/>
|
|
56
62
|
</Box>
|
|
57
63
|
)}
|
|
@@ -20,7 +20,10 @@ const PaymentDetailsActions = ({
|
|
|
20
20
|
isPaymentPlan,
|
|
21
21
|
nextAutopayDate,
|
|
22
22
|
obligationAssocID,
|
|
23
|
-
dueDate
|
|
23
|
+
dueDate,
|
|
24
|
+
description,
|
|
25
|
+
subDescription,
|
|
26
|
+
allowedPaymentInstruments
|
|
24
27
|
}) => {
|
|
25
28
|
const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
26
29
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -73,6 +76,9 @@ const PaymentDetailsActions = ({
|
|
|
73
76
|
paymentPlanSchedule={paymentPlanSchedule}
|
|
74
77
|
isPaymentPlan={isPaymentPlan}
|
|
75
78
|
nextAutopayDate={nextAutopayDate}
|
|
79
|
+
description={description}
|
|
80
|
+
subDescription={subDescription}
|
|
81
|
+
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
76
82
|
/>
|
|
77
83
|
</Cluster>
|
|
78
84
|
</Box>
|
|
@@ -128,6 +134,9 @@ const PaymentDetailsActions = ({
|
|
|
128
134
|
isPaymentPlan={isPaymentPlan}
|
|
129
135
|
nextAutopayDate={nextAutopayDate}
|
|
130
136
|
dueDate={dueDate}
|
|
137
|
+
description={description}
|
|
138
|
+
subDescription={subDescription}
|
|
139
|
+
allowedPaymentInstruments={allowedPaymentInstruments}
|
|
131
140
|
/>
|
|
132
141
|
)}
|
|
133
142
|
</Box>
|
|
@@ -48,7 +48,10 @@ const RadioGroup = ({
|
|
|
48
48
|
groupName={groupName}
|
|
49
49
|
setValue={setValue}
|
|
50
50
|
handleChange={handleChange}
|
|
51
|
-
aria-invalid={
|
|
51
|
+
aria-invalid={
|
|
52
|
+
(field.dirty && field.hasErrors) ||
|
|
53
|
+
(field.hasErrors && showErrors)
|
|
54
|
+
}
|
|
52
55
|
/>
|
|
53
56
|
))}
|
|
54
57
|
</Stack>
|
|
@@ -7,7 +7,7 @@ import RadioButton from "./radio-button/RadioButton";
|
|
|
7
7
|
import { Box, Cluster, Stack, Motion } from "../../atoms/layouts";
|
|
8
8
|
import { noop } from "../../../util/general";
|
|
9
9
|
import Text from "../../atoms/text";
|
|
10
|
-
import { CHARADE_GREY
|
|
10
|
+
import { CHARADE_GREY } from "../../../constants/colors";
|
|
11
11
|
/*
|
|
12
12
|
Takes an array of section objects, each object should look like:
|
|
13
13
|
{
|
|
@@ -17,7 +17,8 @@ import { CHARADE_GREY, ASH_GREY, FIRE_YELLOW } from "../../../constants/colors";
|
|
|
17
17
|
hideRadioButton: boolean, (keeps section displayed but hides radio and disables open/close function),
|
|
18
18
|
hidden: boolean, (hides section entirely)
|
|
19
19
|
dataQa: string,
|
|
20
|
-
content: <React Component(s)> e.g.: <Box><Stack>cool content stuff</Stack></Box> (any collection of components will work)
|
|
20
|
+
content: <React Component(s)> e.g.: <Box><Stack>cool content stuff</Stack></Box> (any collection of components will work),
|
|
21
|
+
rightTitleContent: <React Component(s)> (rendered on the very right of the title section, use to supplement "rightIcons" with text, as in expired CC status, or render other custom content)
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
Also takes an "openSection" which should equal the id of the section that should be open
|
|
@@ -30,10 +31,6 @@ import { CHARADE_GREY, ASH_GREY, FIRE_YELLOW } from "../../../constants/colors";
|
|
|
30
31
|
|
|
31
32
|
*/
|
|
32
33
|
|
|
33
|
-
const ACTIVE = "ACTIVE";
|
|
34
|
-
const EXPIRING_SOON = "EXPIRING_SOON";
|
|
35
|
-
const EXPIRED = "EXPIRED";
|
|
36
|
-
|
|
37
34
|
const RadioSection = ({
|
|
38
35
|
themeValues,
|
|
39
36
|
isMobile,
|
|
@@ -51,44 +48,6 @@ const RadioSection = ({
|
|
|
51
48
|
}
|
|
52
49
|
};
|
|
53
50
|
|
|
54
|
-
const renderCardStatus = item => {
|
|
55
|
-
const { expirationStatus, expireDate } = item;
|
|
56
|
-
switch (expirationStatus) {
|
|
57
|
-
case ACTIVE:
|
|
58
|
-
return (
|
|
59
|
-
<Text
|
|
60
|
-
variant="pXS"
|
|
61
|
-
color={ASH_GREY}
|
|
62
|
-
extraStyles={`text-align: right;`}
|
|
63
|
-
>
|
|
64
|
-
Exp Date {expireDate}
|
|
65
|
-
</Text>
|
|
66
|
-
);
|
|
67
|
-
case EXPIRING_SOON:
|
|
68
|
-
return (
|
|
69
|
-
<Text
|
|
70
|
-
variant="pXS"
|
|
71
|
-
color={FIRE_YELLOW}
|
|
72
|
-
extraStyles={`text-align: right;`}
|
|
73
|
-
>
|
|
74
|
-
Expiring Soon {expireDate}
|
|
75
|
-
</Text>
|
|
76
|
-
);
|
|
77
|
-
case EXPIRED:
|
|
78
|
-
return (
|
|
79
|
-
<Text
|
|
80
|
-
variant="pXS"
|
|
81
|
-
color={ASH_GREY}
|
|
82
|
-
extraStyles={`text-align: right;`}
|
|
83
|
-
>
|
|
84
|
-
Expired
|
|
85
|
-
</Text>
|
|
86
|
-
);
|
|
87
|
-
default:
|
|
88
|
-
null;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
51
|
const wrapper = {
|
|
93
52
|
open: {
|
|
94
53
|
height: openHeight,
|
|
@@ -146,9 +105,9 @@ const RadioSection = ({
|
|
|
146
105
|
tabIndex={
|
|
147
106
|
section.hideRadioButton || section.disabled ? "-1" : "0"
|
|
148
107
|
}
|
|
149
|
-
onKeyDown={e => handleKeyDown(section.id, e)}
|
|
150
|
-
onFocus={() => setFocused(section.id)}
|
|
151
|
-
onBlur={() => setFocused(null)}
|
|
108
|
+
onKeyDown={e => !section.disabled && handleKeyDown(section.id, e)}
|
|
109
|
+
onFocus={() => !section.disabled && setFocused(section.id)}
|
|
110
|
+
onBlur={() => !section.disabled && setFocused(null)}
|
|
152
111
|
hoverStyles={themeValues.focusStyles}
|
|
153
112
|
animate={openSection === section.id ? "open" : "closed"}
|
|
154
113
|
initial={initiallyOpen ? "open" : "closed"}
|
|
@@ -173,7 +132,7 @@ const RadioSection = ({
|
|
|
173
132
|
: () => toggleOpenSection(section.id)
|
|
174
133
|
}
|
|
175
134
|
onTouchEnd={
|
|
176
|
-
|
|
135
|
+
isMobile && supportsTouch && !section.disabled
|
|
177
136
|
? () => toggleOpenSection(section.id)
|
|
178
137
|
: noop
|
|
179
138
|
}
|
|
@@ -232,8 +191,8 @@ const RadioSection = ({
|
|
|
232
191
|
))}
|
|
233
192
|
</Cluster>
|
|
234
193
|
)}
|
|
235
|
-
{section.
|
|
236
|
-
<Fragment>{
|
|
194
|
+
{section.rightTitleContent && (
|
|
195
|
+
<Fragment>{rightTitleContent}</Fragment>
|
|
237
196
|
)}
|
|
238
197
|
</Cluster>
|
|
239
198
|
</Box>
|