@thecb/components 5.9.0-beta.5 → 5.9.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 +1344 -407
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1391 -453
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -4
- package/src/components/atoms/add-obligation/AddObligation.js +1 -3
- package/src/components/atoms/amount-callout/AmountCallout.theme.js +1 -1
- package/src/components/atoms/button-with-action/ButtonWithAction.js +0 -2
- package/src/components/atoms/icons/AutopayOnIcon.js +10 -4
- package/src/components/atoms/layouts/Box.styled.js +5 -3
- package/src/components/atoms/layouts/Cluster.js +1 -1
- package/src/components/atoms/layouts/Cluster.styled.js +1 -1
- package/src/components/atoms/text/Text.js +0 -2
- package/src/components/atoms/text/Text.styled.js +0 -1
- package/src/components/molecules/obligation/Obligation.js +16 -46
- package/src/components/molecules/obligation/modules/AmountModule.js +0 -1
- package/src/components/molecules/obligation/modules/AutopayModalModule.js +47 -80
- package/src/components/molecules/obligation/modules/InactiveControlsModule.js +10 -20
- package/src/components/molecules/obligation/modules/InactiveTitleModule.js +2 -2
- package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +10 -9
- package/src/components/molecules/obligation/modules/index.js +1 -3
- package/src/components/molecules/tab-sidebar/TabSidebar.js +2 -3
- package/src/components/templates/center-single/CenterSingle.js +1 -2
- package/src/components/templates/center-stack/CenterStack.js +1 -2
- package/src/components/templates/default-page-template/DefaultPageTemplate.js +1 -2
- package/src/components/templates/sidebar-single-content/SidebarSingleContent.js +1 -2
- package/src/components/templates/sidebar-stack-content/SidebarStackContent.js +1 -2
- package/src/components/templates/templates.theme.js +1 -1
- package/src/constants/colors.js +8 -10
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/molecules/.DS_Store +0 -0
- package/src/components/molecules/obligation/modules/RemoveAccountModalModule.js +0 -62
- package/src/deprecated/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.1",
|
|
4
4
|
"description": "Common lib for CityBase react components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -61,14 +61,12 @@
|
|
|
61
61
|
"rollup-plugin-node-resolve": "^5.1.0",
|
|
62
62
|
"rollup-plugin-visualizer": "^4.0.4",
|
|
63
63
|
"storybook": "^5.3.14",
|
|
64
|
-
"styled-components": "5.1.1",
|
|
65
64
|
"styled-theming": "^2.2.0"
|
|
66
65
|
},
|
|
67
66
|
"peerDependencies": {
|
|
68
67
|
"react": "^16.13.1",
|
|
69
68
|
"react-dom": "^16.13.1",
|
|
70
69
|
"react-router-dom": "6.0.0-alpha.3",
|
|
71
|
-
"styled-components": "5.1.1",
|
|
72
70
|
"styled-theming": "^2.2.0"
|
|
73
71
|
},
|
|
74
72
|
"husky": {
|
|
@@ -85,6 +83,7 @@
|
|
|
85
83
|
"ramda": "^0.27.0",
|
|
86
84
|
"react-aria-modal": "^4.0.0",
|
|
87
85
|
"react-pose": "^4.0.10",
|
|
88
|
-
"redux-freeform": "^5.5.0"
|
|
86
|
+
"redux-freeform": "^5.5.0",
|
|
87
|
+
"styled-components": "^5.1.1"
|
|
89
88
|
}
|
|
90
89
|
}
|
|
@@ -12,8 +12,7 @@ const AddObligation = ({
|
|
|
12
12
|
action,
|
|
13
13
|
themeValues,
|
|
14
14
|
extraStyles,
|
|
15
|
-
textExtraStyles
|
|
16
|
-
dataQa
|
|
15
|
+
textExtraStyles
|
|
17
16
|
}) => {
|
|
18
17
|
const hoverStyles = `
|
|
19
18
|
&:hover {
|
|
@@ -49,7 +48,6 @@ const AddObligation = ({
|
|
|
49
48
|
extraStyles={defaultStyles}
|
|
50
49
|
onClick={action}
|
|
51
50
|
tabIndex="0"
|
|
52
|
-
dataQa={dataQa}
|
|
53
51
|
>
|
|
54
52
|
<Cover singleChild minHeight="100%">
|
|
55
53
|
<Cluster justify="center" align="center" minHeight="100%">
|
|
@@ -64,7 +64,6 @@ const ButtonWithAction = ({
|
|
|
64
64
|
action = noop,
|
|
65
65
|
variant = "primary",
|
|
66
66
|
text,
|
|
67
|
-
textWrap = false,
|
|
68
67
|
isLoading = false,
|
|
69
68
|
dataQa = null,
|
|
70
69
|
textExtraStyles,
|
|
@@ -144,7 +143,6 @@ const ButtonWithAction = ({
|
|
|
144
143
|
weight={themeValues.fontWeight}
|
|
145
144
|
variant={themeValues.fontSizeVariant}
|
|
146
145
|
color={themeValues.color}
|
|
147
|
-
textWrap={textWrap}
|
|
148
146
|
extraStyles={textExtraStyles}
|
|
149
147
|
>
|
|
150
148
|
{text}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { fallbackValues } from "./Icons.theme";
|
|
3
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
3
4
|
|
|
4
|
-
const AutopayOnIcon = () => (
|
|
5
|
+
const AutopayOnIcon = ({ themeValues }) => (
|
|
5
6
|
<svg
|
|
6
7
|
xmlns="http://www.w3.org/2000/svg"
|
|
7
8
|
width="12"
|
|
@@ -11,7 +12,7 @@ const AutopayOnIcon = () => (
|
|
|
11
12
|
<g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
|
|
12
13
|
<path
|
|
13
14
|
className="autopayIcon"
|
|
14
|
-
fill={
|
|
15
|
+
fill={themeValues.primaryColor}
|
|
15
16
|
fillRule="nonzero"
|
|
16
17
|
d="M1.898 5.75c.079 0 .141-.02.188-.059a.281.281 0 00.094-.152 3.825 3.825 0 011.394-2.144A3.838 3.838 0 016 2.563c.5 0 .98.09 1.441.27.461.179.88.44 1.254.784l-.984.985A.542.542 0 007.547 5c0 .156.055.29.164.398.11.11.242.165.398.165h3.141c.156 0 .289-.055.398-.165A.542.542 0 0011.812 5V1.86a.542.542 0 00-.164-.399.542.542 0 00-.398-.164.542.542 0 00-.398.164l-.844.844A5.699 5.699 0 006 .688c-.938 0-1.809.207-2.613.62-.805.415-1.48.981-2.028 1.7A5.726 5.726 0 00.281 5.422a.265.265 0 00.059.223c.055.07.129.105.222.105h1.336zM6 12.312c.937 0 1.809-.207 2.613-.62a5.919 5.919 0 002.028-1.7 5.726 5.726 0 001.078-2.414.265.265 0 00-.059-.223.267.267 0 00-.223-.105h-1.335c-.079 0-.141.02-.188.059a.281.281 0 00-.094.152 3.825 3.825 0 01-1.394 2.144c-.711.555-1.52.833-2.426.833-.5 0-.98-.09-1.441-.27a3.985 3.985 0 01-1.254-.785l.984-.985A.542.542 0 004.453 8a.542.542 0 00-.164-.398.542.542 0 00-.398-.164H.75a.542.542 0 00-.398.164A.542.542 0 00.187 8v3.14c0 .157.055.29.165.4.109.108.242.163.398.163.156 0 .29-.055.398-.164l.844-.844A5.699 5.699 0 006 12.312z"
|
|
17
18
|
></path>
|
|
@@ -19,4 +20,9 @@ const AutopayOnIcon = () => (
|
|
|
19
20
|
</svg>
|
|
20
21
|
);
|
|
21
22
|
|
|
22
|
-
export default
|
|
23
|
+
export default themeComponent(
|
|
24
|
+
AutopayOnIcon,
|
|
25
|
+
"Icons",
|
|
26
|
+
fallbackValues,
|
|
27
|
+
"primary"
|
|
28
|
+
);
|
|
@@ -35,8 +35,8 @@ export const BoxWrapper = styled(
|
|
|
35
35
|
position: relative;
|
|
36
36
|
box-sizing: border-box;
|
|
37
37
|
padding: ${({ padding }) => padding};
|
|
38
|
-
border: ${({
|
|
39
|
-
|
|
38
|
+
border: ${({ borderSize, borderColor }) =>
|
|
39
|
+
`${borderSize} solid ${borderColor}`};
|
|
40
40
|
box-shadow: ${({ boxShadow }) => boxShadow};
|
|
41
41
|
background-color: ${({ background }) => background};
|
|
42
42
|
min-height: ${({ minHeight }) => (minHeight ? minHeight : "auto")};
|
|
@@ -45,7 +45,9 @@ export const BoxWrapper = styled(
|
|
|
45
45
|
max-width: ${({ maxWidth }) => (maxWidth ? maxWidth : "auto")};
|
|
46
46
|
color: ${({ color }) => color};
|
|
47
47
|
border-radius: ${({ borderRadius }) => borderRadius};
|
|
48
|
-
border-width: ${({ borderWidthOverride }) =>
|
|
48
|
+
border-width: ${({ borderWidthOverride, borderSize }) =>
|
|
49
|
+
borderWidthOverride ? borderWidthOverride : borderSize};
|
|
50
|
+
border: ${({ border }) => border};
|
|
49
51
|
text-align: ${({ textAlign }) => textAlign};
|
|
50
52
|
|
|
51
53
|
&:hover {
|
|
@@ -16,7 +16,7 @@ export const ClusterWrapper = styled(({ overflow, ...props }) => (
|
|
|
16
16
|
export const ClusterInnerWrapper = styled.div`
|
|
17
17
|
box-sizing: border-box;
|
|
18
18
|
display: flex;
|
|
19
|
-
flex-wrap: ${({
|
|
19
|
+
flex-wrap: ${({ nowrap }) => (nowrap ? "nowrap" : "wrap")};
|
|
20
20
|
justify-content: ${({ justify }) => justify};
|
|
21
21
|
align-items: ${({ align }) => align};
|
|
22
22
|
margin: calc(${({ childGap }) => childGap} / 2 * -1);
|
|
@@ -10,7 +10,6 @@ const Text = ({
|
|
|
10
10
|
themeValues,
|
|
11
11
|
weight = FONT_WEIGHT_REGULAR,
|
|
12
12
|
color = FIREFLY_GREY,
|
|
13
|
-
textWrap = true,
|
|
14
13
|
extraStyles = ``,
|
|
15
14
|
hoverStyles,
|
|
16
15
|
onClick,
|
|
@@ -31,7 +30,6 @@ const Text = ({
|
|
|
31
30
|
onClick={onClick}
|
|
32
31
|
onKeyPress={onKeyPress}
|
|
33
32
|
data-qa={dataQa}
|
|
34
|
-
$textWrap={textWrap}
|
|
35
33
|
{...rest}
|
|
36
34
|
>
|
|
37
35
|
{safeChildren(children, <span />)}
|
|
@@ -8,7 +8,6 @@ export const TextSpan = styled.span`
|
|
|
8
8
|
font-weight: ${({ weight }) => weight};
|
|
9
9
|
font-family: ${({ fontFamily }) => fontFamily};
|
|
10
10
|
color: ${({ color }) => color};
|
|
11
|
-
white-space: ${({ $textWrap }) => ($textWrap ? "initial" : "nowrap")};
|
|
12
11
|
|
|
13
12
|
&:hover {
|
|
14
13
|
${({ hoverStyles }) =>
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Box, Cluster, Stack } from "../../../components/atoms/layouts";
|
|
3
|
-
import {
|
|
4
|
-
WHITE,
|
|
5
|
-
BRIGHT_GREY,
|
|
6
|
-
ATHENS_GREY,
|
|
7
|
-
GRECIAN_GREY
|
|
8
|
-
} from "../../../constants/colors";
|
|
3
|
+
import { WHITE, BRIGHT_GREY, ATHENS_GREY } from "../../../constants/colors";
|
|
9
4
|
import {
|
|
10
5
|
IconModule,
|
|
11
6
|
TitleModule,
|
|
@@ -30,43 +25,26 @@ const Obligation = ({
|
|
|
30
25
|
isPaymentPlan,
|
|
31
26
|
nextAutopayDate,
|
|
32
27
|
obligationAssocID,
|
|
33
|
-
|
|
34
|
-
agencyName,
|
|
35
|
-
inactive = false,
|
|
28
|
+
isActive = true,
|
|
36
29
|
inactiveLookupTitle = "",
|
|
37
30
|
inactiveLookupInput = "Account",
|
|
38
31
|
inactiveLookupValue = ""
|
|
39
32
|
}) => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- A single obligation
|
|
43
|
-
- A group of obligations (a "collection")
|
|
44
|
-
|
|
45
|
-
The top level desc/subdesc for all obligations in a collection is the same
|
|
46
|
-
(Collection accounts look different in the Account Details page)
|
|
47
|
-
*/
|
|
48
|
-
const firstObligation = obligations[0];
|
|
49
|
-
const customAttributes = firstObligation?.customAttributes ?? {};
|
|
33
|
+
const obligation = obligations[0];
|
|
34
|
+
const { customAttributes } = obligation;
|
|
50
35
|
const boxShadowValue =
|
|
51
|
-
"0px
|
|
36
|
+
"0px 4px 4px rgba(41, 42, 51, 0.1), 0px 1px 1px 2px rgba(41, 42, 51, 0.1);";
|
|
52
37
|
const activeObligation = (
|
|
53
38
|
<Box
|
|
54
39
|
padding="0"
|
|
55
40
|
borderRadius="4px"
|
|
56
41
|
boxShadow={boxShadowValue}
|
|
57
42
|
as="section"
|
|
58
|
-
aria-label={`${
|
|
59
|
-
"account"} ${firstObligation?.subDescription ?? obligationAssocID}`}
|
|
60
|
-
border={`1px solid ${GRECIAN_GREY}`}
|
|
61
|
-
borderWidthOverride="1px 0 0 0"
|
|
43
|
+
aria-label={`${obligation.description} ${obligation.subDescription}`}
|
|
62
44
|
>
|
|
63
|
-
<Box background={WHITE}
|
|
45
|
+
<Box background={WHITE}>
|
|
64
46
|
<Stack childGap="14px">
|
|
65
|
-
<Box
|
|
66
|
-
key={`${firstObligation?.id}-top`}
|
|
67
|
-
padding="0 8px"
|
|
68
|
-
minWidth="100%"
|
|
69
|
-
>
|
|
47
|
+
<Box key={`${obligations[0].id}-top`} padding="0 8px" minWidth="100%">
|
|
70
48
|
<Cluster
|
|
71
49
|
justify="space-between"
|
|
72
50
|
align="center"
|
|
@@ -85,8 +63,8 @@ const Obligation = ({
|
|
|
85
63
|
/>
|
|
86
64
|
)}
|
|
87
65
|
<TitleModule
|
|
88
|
-
title={
|
|
89
|
-
subtitle={
|
|
66
|
+
title={obligation.description}
|
|
67
|
+
subtitle={obligation.subDescription}
|
|
90
68
|
titleColor={BRIGHT_GREY}
|
|
91
69
|
isMobile={isMobile}
|
|
92
70
|
/>
|
|
@@ -94,7 +72,7 @@ const Obligation = ({
|
|
|
94
72
|
</Box>
|
|
95
73
|
{!isMobile && (
|
|
96
74
|
<AmountModule
|
|
97
|
-
totalAmountDue={obligations
|
|
75
|
+
totalAmountDue={obligations.reduce(
|
|
98
76
|
(acc, curr) => acc + curr.amountDue,
|
|
99
77
|
0
|
|
100
78
|
)}
|
|
@@ -125,7 +103,6 @@ const Obligation = ({
|
|
|
125
103
|
isMobile={isMobile}
|
|
126
104
|
isPaymentPlan={isPaymentPlan}
|
|
127
105
|
nextAutopayDate={nextAutopayDate}
|
|
128
|
-
obligationAssocID={obligationAssocID}
|
|
129
106
|
/>
|
|
130
107
|
)}
|
|
131
108
|
</Stack>
|
|
@@ -145,7 +122,6 @@ const Obligation = ({
|
|
|
145
122
|
isMobile={isMobile}
|
|
146
123
|
isPaymentPlan={isPaymentPlan}
|
|
147
124
|
nextAutopayDate={nextAutopayDate}
|
|
148
|
-
obligationAssocID={obligationAssocID}
|
|
149
125
|
/>
|
|
150
126
|
)}
|
|
151
127
|
</Box>
|
|
@@ -159,17 +135,17 @@ const Obligation = ({
|
|
|
159
135
|
as="section"
|
|
160
136
|
aria-label={`${inactiveLookupTitle} ${inactiveLookupInput}: ${inactiveLookupValue}`}
|
|
161
137
|
>
|
|
162
|
-
<Box background={ATHENS_GREY}
|
|
138
|
+
<Box background={ATHENS_GREY}>
|
|
163
139
|
<Stack childGap="14px">
|
|
164
|
-
<Box key={`${
|
|
140
|
+
<Box key={`${obligations[0].id}-top`} padding="0 8px" minWidth="100%">
|
|
165
141
|
<Cluster
|
|
166
142
|
justify="space-between"
|
|
167
143
|
align="center"
|
|
168
|
-
childGap="
|
|
144
|
+
childGap="4px"
|
|
169
145
|
nowrap
|
|
170
146
|
>
|
|
171
147
|
<Box padding="0">
|
|
172
|
-
<Cluster justify="flex-start" align="center"
|
|
148
|
+
<Cluster justify="flex-start" align="center">
|
|
173
149
|
<IconModule
|
|
174
150
|
icon={config.icon}
|
|
175
151
|
iconDefault={config.iconDefault}
|
|
@@ -198,9 +174,6 @@ const Obligation = ({
|
|
|
198
174
|
isMobile={isMobile}
|
|
199
175
|
nextAutopayDate={nextAutopayDate}
|
|
200
176
|
obligationAssocID={obligationAssocID}
|
|
201
|
-
dueDate={dueDate}
|
|
202
|
-
agencyName={agencyName}
|
|
203
|
-
configType={config.type}
|
|
204
177
|
/>
|
|
205
178
|
)}
|
|
206
179
|
</Cluster>
|
|
@@ -217,9 +190,6 @@ const Obligation = ({
|
|
|
217
190
|
isMobile={isMobile}
|
|
218
191
|
nextAutopayDate={nextAutopayDate}
|
|
219
192
|
obligationAssocID={obligationAssocID}
|
|
220
|
-
dueDate={dueDate}
|
|
221
|
-
agencyName={agencyName}
|
|
222
|
-
configType={config.type}
|
|
223
193
|
/>
|
|
224
194
|
)}
|
|
225
195
|
</Stack>
|
|
@@ -227,7 +197,7 @@ const Obligation = ({
|
|
|
227
197
|
</Box>
|
|
228
198
|
);
|
|
229
199
|
|
|
230
|
-
return
|
|
200
|
+
return isActive ? activeObligation : inactiveObligation;
|
|
231
201
|
};
|
|
232
202
|
|
|
233
203
|
export default Obligation;
|
|
@@ -16,16 +16,13 @@ const AutopayModal = ({
|
|
|
16
16
|
modalOpen,
|
|
17
17
|
deactivatePaymentSchedule,
|
|
18
18
|
navigateToSettings,
|
|
19
|
-
|
|
19
|
+
buttonLinkType,
|
|
20
20
|
isMobile,
|
|
21
21
|
themeValues,
|
|
22
22
|
isPaymentPlan,
|
|
23
|
-
nextAutopayDate
|
|
24
|
-
dueDate,
|
|
25
|
-
inactive
|
|
23
|
+
nextAutopayDate
|
|
26
24
|
}) => {
|
|
27
25
|
const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
28
|
-
const nextDate = dueDate || nextAutopayDate;
|
|
29
26
|
const modalExtraProps = {
|
|
30
27
|
modalHeaderText: autoPayActive
|
|
31
28
|
? `Deactivate ${planType}`
|
|
@@ -33,11 +30,7 @@ const AutopayModal = ({
|
|
|
33
30
|
modalBodyText: autoPayActive
|
|
34
31
|
? `Are you sure you want to deactivate ${
|
|
35
32
|
isPaymentPlan ? "your payment plan" : "autopay"
|
|
36
|
-
}?
|
|
37
|
-
!inactive && nextDate
|
|
38
|
-
? `Your next payment will be due on ${nextDate}.`
|
|
39
|
-
: ""
|
|
40
|
-
}`
|
|
33
|
+
}? You will need to manually make your next payment.`
|
|
41
34
|
: `To set up ${
|
|
42
35
|
isPaymentPlan ? "a payment plan" : "autopay"
|
|
43
36
|
} you must save a payment method and address in your profile. Do you want to save these now?`,
|
|
@@ -69,75 +62,6 @@ const AutopayModal = ({
|
|
|
69
62
|
const defaultStyles = `
|
|
70
63
|
.autopayIcon { fill: ${themeValues.color}; text-decoration: underline; }
|
|
71
64
|
`;
|
|
72
|
-
const renderAutoPayControl = () => {
|
|
73
|
-
switch (controlType) {
|
|
74
|
-
case "secondary": {
|
|
75
|
-
return (
|
|
76
|
-
<ButtonWithAction
|
|
77
|
-
text={autoPayActive ? `Turn off ${planType}` : `Set Up ${planType}`}
|
|
78
|
-
variant="secondary"
|
|
79
|
-
action={() => {
|
|
80
|
-
toggleModal(true);
|
|
81
|
-
}}
|
|
82
|
-
dataQa="Turn off Autopay"
|
|
83
|
-
extraStyles={
|
|
84
|
-
isMobile
|
|
85
|
-
? `flex-grow: 1; width: 100%; margin: 0;`
|
|
86
|
-
: `flex-grow: 1; min-width: 165px;`
|
|
87
|
-
}
|
|
88
|
-
/>
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
case "tertiary": {
|
|
92
|
-
return (
|
|
93
|
-
<ButtonWithAction
|
|
94
|
-
text={autoPayActive ? `Manage ${planType}` : `Set Up ${planType}`}
|
|
95
|
-
variant="tertiary"
|
|
96
|
-
action={() => {
|
|
97
|
-
toggleModal(true);
|
|
98
|
-
}}
|
|
99
|
-
dataQa="Manage Autopay"
|
|
100
|
-
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
101
|
-
/>
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
case "link": {
|
|
105
|
-
return (
|
|
106
|
-
<Box
|
|
107
|
-
padding="0"
|
|
108
|
-
onClick={() => {
|
|
109
|
-
toggleModal(true);
|
|
110
|
-
}}
|
|
111
|
-
hoverStyles={hoverStyles}
|
|
112
|
-
activeStyles={activeStyles}
|
|
113
|
-
extraStyles={defaultStyles}
|
|
114
|
-
>
|
|
115
|
-
<Cluster
|
|
116
|
-
justify={isMobile ? "flex-start" : "flex-end"}
|
|
117
|
-
align="center"
|
|
118
|
-
>
|
|
119
|
-
<AutopayOnIcon />
|
|
120
|
-
<Text
|
|
121
|
-
variant="pS"
|
|
122
|
-
onClick={() => toggleModal(true)}
|
|
123
|
-
onKeyPress={e => {
|
|
124
|
-
e.key === "Enter" && toggleModal(true);
|
|
125
|
-
}}
|
|
126
|
-
tabIndex="0"
|
|
127
|
-
dataQa={`${planType} On`}
|
|
128
|
-
color={SEA_GREEN}
|
|
129
|
-
weight={themeValues.fontWeight}
|
|
130
|
-
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
131
|
-
extraStyles={`padding-left: 0.25rem;`}
|
|
132
|
-
>
|
|
133
|
-
{`${planType} ${nextAutopayDate}`}
|
|
134
|
-
</Text>
|
|
135
|
-
</Cluster>
|
|
136
|
-
</Box>
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
65
|
return (
|
|
142
66
|
<Modal
|
|
143
67
|
showModal={() => toggleModal(true)}
|
|
@@ -145,7 +69,50 @@ const AutopayModal = ({
|
|
|
145
69
|
modalOpen={modalOpen}
|
|
146
70
|
{...modalExtraProps}
|
|
147
71
|
>
|
|
148
|
-
{
|
|
72
|
+
{buttonLinkType ? (
|
|
73
|
+
<ButtonWithAction
|
|
74
|
+
text={autoPayActive ? `Manage ${planType}` : `Set Up ${planType}`}
|
|
75
|
+
variant="tertiary"
|
|
76
|
+
action={() => {
|
|
77
|
+
toggleModal(true);
|
|
78
|
+
}}
|
|
79
|
+
dataQa="Manage Autopay"
|
|
80
|
+
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
81
|
+
/>
|
|
82
|
+
) : (
|
|
83
|
+
<Box
|
|
84
|
+
padding="0"
|
|
85
|
+
onClick={() => {
|
|
86
|
+
toggleModal(true);
|
|
87
|
+
}}
|
|
88
|
+
hoverStyles={hoverStyles}
|
|
89
|
+
activeStyles={activeStyles}
|
|
90
|
+
extraStyles={defaultStyles}
|
|
91
|
+
>
|
|
92
|
+
<Cluster
|
|
93
|
+
justify={isMobile ? "flex-start" : "flex-end"}
|
|
94
|
+
align="center"
|
|
95
|
+
>
|
|
96
|
+
<AutopayOnIcon />
|
|
97
|
+
<Text
|
|
98
|
+
variant="pS"
|
|
99
|
+
onClick={() => toggleModal(true)}
|
|
100
|
+
onKeyPress={e => {
|
|
101
|
+
console.log({ e });
|
|
102
|
+
e.key === "Enter" && toggleModal(true);
|
|
103
|
+
}}
|
|
104
|
+
tabIndex="0"
|
|
105
|
+
dataQa={`${planType} On`}
|
|
106
|
+
color={SEA_GREEN}
|
|
107
|
+
weight={themeValues.fontWeight}
|
|
108
|
+
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
109
|
+
extraStyles={`padding-left: 0.25rem;`}
|
|
110
|
+
>
|
|
111
|
+
{`${planType} ${nextAutopayDate}`}
|
|
112
|
+
</Text>
|
|
113
|
+
</Cluster>
|
|
114
|
+
</Box>
|
|
115
|
+
)}
|
|
149
116
|
</Modal>
|
|
150
117
|
);
|
|
151
118
|
};
|
|
@@ -3,7 +3,6 @@ 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";
|
|
7
6
|
|
|
8
7
|
const InactiveControlsModule = ({
|
|
9
8
|
autoPayEnabled,
|
|
@@ -15,26 +14,18 @@ const InactiveControlsModule = ({
|
|
|
15
14
|
isPaymentPlan,
|
|
16
15
|
nextAutopayDate,
|
|
17
16
|
obligationAssocID,
|
|
18
|
-
dueDate,
|
|
19
|
-
agencyName,
|
|
20
|
-
configType,
|
|
21
17
|
actions
|
|
22
18
|
}) => {
|
|
23
19
|
const [modalOpen, toggleModal] = useState(false);
|
|
24
|
-
const {
|
|
25
|
-
const handleRemoveAccount = () =>
|
|
20
|
+
const { removeAccount } = actions;
|
|
21
|
+
const handleRemoveAccount = () => removeAccount(obligationAssocID);
|
|
26
22
|
return (
|
|
27
23
|
<Box
|
|
28
24
|
padding={isMobile ? "18px 0 0 0" : "0"}
|
|
29
25
|
border={isMobile ? `1px solid ${GHOST_GREY}` : `0px`}
|
|
30
26
|
borderWidthOverride={isMobile ? `1px 0 0 0` : `0px`}
|
|
31
27
|
>
|
|
32
|
-
<Cluster
|
|
33
|
-
childGap={autoPayEnabled ? `8px` : "0"}
|
|
34
|
-
nowrap
|
|
35
|
-
justify={isMobile && autoPayEnabled && "center"}
|
|
36
|
-
align={isMobile && autoPayEnabled && "center"}
|
|
37
|
-
>
|
|
28
|
+
<Cluster childGap={isMobile ? `8px` : `18px`}>
|
|
38
29
|
{autoPayEnabled && (
|
|
39
30
|
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
40
31
|
<AutopayModalModule
|
|
@@ -44,23 +35,22 @@ const InactiveControlsModule = ({
|
|
|
44
35
|
modalOpen={modalOpen}
|
|
45
36
|
navigateToSettings={navigateToSettings}
|
|
46
37
|
deactivatePaymentSchedule={deactivatePaymentSchedule}
|
|
38
|
+
buttonLinkType
|
|
47
39
|
isMobile={isMobile}
|
|
48
40
|
paymentPlanSchedule={paymentPlanSchedule}
|
|
49
41
|
isPaymentPlan={isPaymentPlan}
|
|
50
42
|
nextAutopayDate={nextAutopayDate}
|
|
51
43
|
obligationAssocID={obligationAssocID}
|
|
52
|
-
dueDate={dueDate}
|
|
53
|
-
controlType="secondary"
|
|
54
|
-
inactive
|
|
55
44
|
/>
|
|
56
45
|
</Box>
|
|
57
46
|
)}
|
|
58
47
|
<Box padding="0" extraStyles={`flex-grow: 1;`}>
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
<ButtonWithAction
|
|
49
|
+
variant="tertiary"
|
|
50
|
+
text="Remove"
|
|
51
|
+
action={handleRemoveAccount}
|
|
52
|
+
dataQa="Remove Account"
|
|
53
|
+
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
64
54
|
/>
|
|
65
55
|
</Box>
|
|
66
56
|
</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 account has been paid off or there was an error loading it. If you have questions about this account, please contact us.${
|
|
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>
|
|
@@ -18,9 +18,7 @@ const PaymentDetailsActions = ({
|
|
|
18
18
|
autoPaySchedule,
|
|
19
19
|
paymentPlanSchedule,
|
|
20
20
|
isPaymentPlan,
|
|
21
|
-
nextAutopayDate
|
|
22
|
-
obligationAssocID,
|
|
23
|
-
dueDate
|
|
21
|
+
nextAutopayDate
|
|
24
22
|
}) => {
|
|
25
23
|
const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
|
|
26
24
|
const [isLoading, setIsLoading] = useState(false);
|
|
@@ -40,7 +38,7 @@ const PaymentDetailsActions = ({
|
|
|
40
38
|
createPaymentFromProfile(obligations, config);
|
|
41
39
|
};
|
|
42
40
|
const handleDetailsClick = () => {
|
|
43
|
-
setDetailedObligation(obligations, config
|
|
41
|
+
setDetailedObligation(obligations, config);
|
|
44
42
|
navigateToDetailedObligation(detailsSlug);
|
|
45
43
|
};
|
|
46
44
|
return (
|
|
@@ -108,7 +106,7 @@ const PaymentDetailsActions = ({
|
|
|
108
106
|
variant="tertiary"
|
|
109
107
|
text={`Set Up ${planType}`}
|
|
110
108
|
action={() => {
|
|
111
|
-
setDetailedObligation(obligations, config
|
|
109
|
+
setDetailedObligation(obligations, config);
|
|
112
110
|
handleAutopayAction();
|
|
113
111
|
}}
|
|
114
112
|
dataQa="Set Up Autopay"
|
|
@@ -122,23 +120,26 @@ const PaymentDetailsActions = ({
|
|
|
122
120
|
modalOpen={modalOpen}
|
|
123
121
|
navigateToSettings={navigateToSettings}
|
|
124
122
|
deactivatePaymentSchedule={deactivatePaymentSchedule}
|
|
125
|
-
|
|
123
|
+
buttonLinkType
|
|
126
124
|
isMobile={isMobile}
|
|
127
125
|
paymentPlanSchedule={paymentPlanSchedule}
|
|
128
126
|
isPaymentPlan={isPaymentPlan}
|
|
129
127
|
nextAutopayDate={nextAutopayDate}
|
|
130
|
-
dueDate={dueDate}
|
|
131
128
|
/>
|
|
132
129
|
)}
|
|
133
130
|
</Box>
|
|
134
131
|
{!isMobile && (
|
|
135
|
-
<Box
|
|
132
|
+
<Box
|
|
133
|
+
padding={isMobile ? "0 0 0 8px" : "0"}
|
|
134
|
+
extraStyles={isMobile && `flex-grow: 1;`}
|
|
135
|
+
>
|
|
136
136
|
<ButtonWithAction
|
|
137
137
|
isLoading={isLoading}
|
|
138
138
|
action={() => handleClick(obligations)}
|
|
139
139
|
text="Pay Now"
|
|
140
140
|
variant={isMobile ? "smallSecondary" : "secondary"}
|
|
141
141
|
dataQa="Pay Now"
|
|
142
|
+
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
142
143
|
/>
|
|
143
144
|
</Box>
|
|
144
145
|
)}
|
|
@@ -151,7 +152,7 @@ const PaymentDetailsActions = ({
|
|
|
151
152
|
text="Pay Now"
|
|
152
153
|
variant={isMobile ? "smallSecondary" : "secondary"}
|
|
153
154
|
dataQa="Pay Now"
|
|
154
|
-
extraStyles={isMobile && `flex-grow: 1; width: 100
|
|
155
|
+
extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
|
|
155
156
|
/>
|
|
156
157
|
</Box>
|
|
157
158
|
)}
|
|
@@ -4,7 +4,6 @@ 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";
|
|
8
7
|
|
|
9
8
|
export {
|
|
10
9
|
IconModule,
|
|
@@ -12,6 +11,5 @@ export {
|
|
|
12
11
|
AmountModule,
|
|
13
12
|
PaymentDetailsActions,
|
|
14
13
|
InactiveControlsModule,
|
|
15
|
-
InactiveTitleModule
|
|
16
|
-
RemoveAccountModalModule
|
|
14
|
+
InactiveTitleModule
|
|
17
15
|
};
|
|
@@ -4,8 +4,7 @@ import {
|
|
|
4
4
|
BRIGHT_GREY,
|
|
5
5
|
GHOST_GREY,
|
|
6
6
|
ATHENS_GREY,
|
|
7
|
-
TRANSPARENT
|
|
8
|
-
COOL_GREY_05
|
|
7
|
+
TRANSPARENT
|
|
9
8
|
} from "../../../constants/colors";
|
|
10
9
|
import Text from "../../atoms/text";
|
|
11
10
|
import { InternalLink } from "../../atoms/link";
|
|
@@ -19,7 +18,7 @@ import { fallbackValues } from "./TabSidebar.theme";
|
|
|
19
18
|
const TabSidebar = ({ links, isMobile, themeValues }) => (
|
|
20
19
|
<Box
|
|
21
20
|
padding="0"
|
|
22
|
-
background={
|
|
21
|
+
background={ATHENS_GREY}
|
|
23
22
|
minHeight="100%"
|
|
24
23
|
role="region"
|
|
25
24
|
aria-label="Profile tabs"
|