@comicrelief/component-library 8.1.1 → 8.2.0
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/.eslintrc +1 -0
- package/dist/components/Atoms/Button/Button.js +3 -7
- package/dist/components/Atoms/ButtonWithStates/ButtonWithStates.js +3 -8
- package/dist/components/Atoms/Checkbox/Checkbox.js +2 -6
- package/dist/components/Atoms/Confetti/Confetti.js +2 -5
- package/dist/components/Atoms/Icons/Arrow.js +4 -10
- package/dist/components/Atoms/Icons/AtSign.js +3 -8
- package/dist/components/Atoms/Icons/Chevron.js +4 -10
- package/dist/components/Atoms/Icons/Download.js +3 -8
- package/dist/components/Atoms/Icons/External.js +3 -8
- package/dist/components/Atoms/Icons/Favourite.js +3 -8
- package/dist/components/Atoms/Icons/Internal.js +3 -8
- package/dist/components/Atoms/Input/Input.js +9 -17
- package/dist/components/Atoms/Label/Label.js +3 -12
- package/dist/components/Atoms/Link/Link.js +9 -18
- package/dist/components/Atoms/Logo/Logo.js +4 -11
- package/dist/components/Atoms/Pagination/Pagination.js +39 -52
- package/dist/components/Atoms/Picture/Picture.js +10 -22
- package/dist/components/Atoms/RichText/RichText.js +2 -6
- package/dist/components/Atoms/Select/Select.js +6 -16
- package/dist/components/Atoms/SocialIcons/SocialIcons.js +2 -3
- package/dist/components/Atoms/Text/Text.js +12 -17
- package/dist/components/Atoms/TextArea/TextArea.js +6 -11
- package/dist/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +2 -9
- package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.js +8 -18
- package/dist/components/Molecules/Banner/Banner.js +1 -4
- package/dist/components/Molecules/Box/Box.js +6 -17
- package/dist/components/Molecules/Card/Card.js +11 -24
- package/dist/components/Molecules/CardDs/CardDs.js +11 -24
- package/dist/components/Molecules/Chip/Chip.js +2 -6
- package/dist/components/Molecules/Countdown/Countdown.js +3 -8
- package/dist/components/Molecules/Logos/Logos.js +1 -4
- package/dist/components/Molecules/Lookup/Lookup.js +2 -6
- package/dist/components/Molecules/Promo/Promo.js +17 -36
- package/dist/components/Molecules/SchoolLookup/SchoolLookup.js +4 -10
- package/dist/components/Molecules/SearchInput/SearchInput.js +1 -4
- package/dist/components/Molecules/SearchResult/SearchResult.js +8 -17
- package/dist/components/Molecules/ShareButton/ShareButton.js +3 -8
- package/dist/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +1 -4
- package/dist/components/Molecules/SingleMessage/SingleMessage.js +15 -32
- package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.js +13 -28
- package/dist/components/Molecules/Typeahead/Typeahead.js +3 -8
- package/dist/components/Molecules/VideoBanner/VideoBanner.js +5 -12
- package/dist/components/Organisms/Donate/Donate.js +31 -65
- package/dist/components/Organisms/Donate/Donate.md +19 -19
- package/dist/components/Organisms/Donate/Form/Form.js +6 -19
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +1 -4
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +3 -3
- package/dist/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +5 -10
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +10 -10
- package/dist/components/Organisms/EmailSignUp/_EmailSignUp.js +4 -9
- package/dist/components/Organisms/EmailSignUp/_TextInput.js +3 -8
- package/dist/components/Organisms/Footer/Footer.js +6 -11
- package/dist/components/Organisms/Footer/Nav/Nav.js +1 -4
- package/dist/components/Organisms/Header/Header.js +2 -6
- package/dist/components/Organisms/Header/Nav/Nav.js +1 -4
- package/dist/components/Organisms/ImpactSlider/ImpactSlider.js +3 -8
- package/dist/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +2 -6
- package/dist/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +6 -16
- package/dist/components/Organisms/MarketingPreferencesDS/_TextInput.js +3 -8
- package/dist/components/Organisms/Membership/Form/Form.js +1 -5
- package/dist/components/Organisms/Membership/Membership.js +9 -19
- package/dist/components/Organisms/Membership/MoneyBox/MoneyBox.js +3 -8
- package/package.json +1 -1
- package/src/components/Atoms/Button/Button.js +3 -8
- package/src/components/Atoms/ButtonWithStates/ButtonWithStates.js +1 -7
- package/src/components/Atoms/Checkbox/Checkbox.js +1 -6
- package/src/components/Atoms/Confetti/Confetti.js +1 -5
- package/src/components/Atoms/Icons/Arrow.js +1 -8
- package/src/components/Atoms/Icons/AtSign.js +1 -7
- package/src/components/Atoms/Icons/Chevron.js +1 -8
- package/src/components/Atoms/Icons/Download.js +1 -7
- package/src/components/Atoms/Icons/External.js +1 -7
- package/src/components/Atoms/Icons/Favourite.js +1 -7
- package/src/components/Atoms/Icons/Internal.js +1 -7
- package/src/components/Atoms/Input/Input.js +9 -18
- package/src/components/Atoms/Label/Label.js +3 -13
- package/src/components/Atoms/Link/Link.js +9 -19
- package/src/components/Atoms/Logo/Logo.js +1 -8
- package/src/components/Atoms/Pagination/Pagination.js +38 -51
- package/src/components/Atoms/Picture/Picture.js +10 -23
- package/src/components/Atoms/RichText/RichText.js +1 -6
- package/src/components/Atoms/Select/Select.js +6 -17
- package/src/components/Atoms/SocialIcons/SocialIcons.js +2 -5
- package/src/components/Atoms/Text/Text.js +4 -13
- package/src/components/Atoms/TextArea/TextArea.js +2 -9
- package/src/components/Atoms/TextInputWithDropdown/TextInputWithDropdown.js +2 -11
- package/src/components/Molecules/ArticleTeaser/ArticleTeaser.js +8 -19
- package/src/components/Molecules/Banner/Banner.js +1 -5
- package/src/components/Molecules/Box/Box.js +6 -18
- package/src/components/Molecules/Card/Card.js +11 -25
- package/src/components/Molecules/CardDs/CardDs.js +11 -25
- package/src/components/Molecules/Chip/Chip.js +1 -6
- package/src/components/Molecules/Countdown/Countdown.js +1 -7
- package/src/components/Molecules/Logos/Logos.js +1 -5
- package/src/components/Molecules/Lookup/Lookup.js +2 -7
- package/src/components/Molecules/Promo/Promo.js +17 -37
- package/src/components/Molecules/SchoolLookup/SchoolLookup.js +4 -11
- package/src/components/Molecules/SearchInput/SearchInput.js +1 -5
- package/src/components/Molecules/SearchResult/SearchResult.js +8 -18
- package/src/components/Molecules/ShareButton/ShareButton.js +1 -7
- package/src/components/Molecules/SimpleSchoolLookup/SimpleSchoolLookup.js +4 -5
- package/src/components/Molecules/SingleMessage/SingleMessage.js +15 -33
- package/src/components/Molecules/SingleMessageDS/SingleMessageDs.js +13 -29
- package/src/components/Molecules/Typeahead/Typeahead.js +3 -9
- package/src/components/Molecules/VideoBanner/VideoBanner.js +7 -9
- package/src/components/Organisms/Donate/Donate.js +32 -67
- package/src/components/Organisms/Donate/Donate.md +19 -19
- package/src/components/Organisms/Donate/Form/Form.js +6 -22
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.js +1 -5
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +3 -3
- package/src/components/Organisms/Donate/MoneyBuy/MoneyBuy.js +5 -11
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +10 -10
- package/src/components/Organisms/EmailSignUp/_EmailSignUp.js +3 -9
- package/src/components/Organisms/EmailSignUp/_TextInput.js +3 -9
- package/src/components/Organisms/Footer/Footer.js +2 -10
- package/src/components/Organisms/Footer/Nav/Nav.js +1 -5
- package/src/components/Organisms/Header/Header.js +1 -6
- package/src/components/Organisms/Header/Nav/Nav.js +1 -5
- package/src/components/Organisms/ImpactSlider/ImpactSlider.js +1 -7
- package/src/components/Organisms/MarketingPreferencesDS/_CheckAnswer.js +1 -6
- package/src/components/Organisms/MarketingPreferencesDS/_MarketingPreferencesDS.js +5 -17
- package/src/components/Organisms/MarketingPreferencesDS/_TextInput.js +1 -7
- package/src/components/Organisms/Membership/Form/Form.js +1 -5
- package/src/components/Organisms/Membership/Membership.js +9 -19
- package/src/components/Organisms/Membership/MoneyBox/MoneyBox.js +3 -9
|
@@ -25,7 +25,7 @@ const MoneyBuyButton = styled(Input)`
|
|
|
25
25
|
&:focus {
|
|
26
26
|
border: none;
|
|
27
27
|
outline: none;
|
|
28
|
-
box-shadow: inset 0 0 0 4px ${({ theme }) => theme.color('
|
|
28
|
+
box-shadow: inset 0 0 0 4px ${({ theme }) => theme.color('blue_donate')};
|
|
29
29
|
}
|
|
30
30
|
&:active:focus {
|
|
31
31
|
box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.3);
|
|
@@ -33,7 +33,7 @@ const MoneyBuyButton = styled(Input)`
|
|
|
33
33
|
|
|
34
34
|
${({ isSelected }) => isSelected
|
|
35
35
|
&& css`
|
|
36
|
-
background-color: ${({ theme }) => theme.color('
|
|
36
|
+
background-color: ${({ theme }) => theme.color('blue_donate')};
|
|
37
37
|
box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.3);
|
|
38
38
|
color: ${({ theme }) => theme.color('white')};
|
|
39
39
|
&:focus {
|
|
@@ -45,9 +45,9 @@ const MoneyBuyButton = styled(Input)`
|
|
|
45
45
|
|
|
46
46
|
const MoneyBuy = ({
|
|
47
47
|
setOtherAmount,
|
|
48
|
-
amount,
|
|
49
|
-
currency,
|
|
50
|
-
description,
|
|
48
|
+
amount = '10',
|
|
49
|
+
currency = '£',
|
|
50
|
+
description = 'description',
|
|
51
51
|
...rest
|
|
52
52
|
}) => (
|
|
53
53
|
<MoneyBuyButton
|
|
@@ -69,10 +69,4 @@ MoneyBuy.propTypes = {
|
|
|
69
69
|
setOtherAmount: PropTypes.func.isRequired
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
MoneyBuy.defaultProps = {
|
|
73
|
-
amount: '10',
|
|
74
|
-
currency: '£',
|
|
75
|
-
description: 'description'
|
|
76
|
-
};
|
|
77
|
-
|
|
78
72
|
export default MoneyBuy;
|
|
@@ -278,7 +278,7 @@ exports[`"Single Giving, No Money Buys, with overridden manual input value" rend
|
|
|
278
278
|
position: absolute;
|
|
279
279
|
-webkit-transition: left 0.15s ease-out;
|
|
280
280
|
transition: left 0.15s ease-out;
|
|
281
|
-
background-color: #
|
|
281
|
+
background-color: #2042AD;
|
|
282
282
|
left: 2px;
|
|
283
283
|
box-shadow: 0px 0px 16px rgba(0,0,0,0.3);
|
|
284
284
|
}
|
|
@@ -327,7 +327,7 @@ exports[`"Single Giving, No Money Buys, with overridden manual input value" rend
|
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
.c8 input:focus:not(:checked) + label {
|
|
330
|
-
box-shadow: inset 0 0 0 4px #
|
|
330
|
+
box-shadow: inset 0 0 0 4px #2042AD;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
.c10 {
|
|
@@ -366,7 +366,7 @@ exports[`"Single Giving, No Money Buys, with overridden manual input value" rend
|
|
|
366
366
|
.c10:focus {
|
|
367
367
|
border: none;
|
|
368
368
|
outline: none;
|
|
369
|
-
box-shadow: inset 0 0 0 4px #
|
|
369
|
+
box-shadow: inset 0 0 0 4px #2042AD;
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
.c9 {
|
|
@@ -405,7 +405,7 @@ exports[`"Single Giving, No Money Buys, with overridden manual input value" rend
|
|
|
405
405
|
.c9:focus {
|
|
406
406
|
border: none;
|
|
407
407
|
outline: none;
|
|
408
|
-
box-shadow: inset 0 0 0 4px #
|
|
408
|
+
box-shadow: inset 0 0 0 4px #2042AD;
|
|
409
409
|
}
|
|
410
410
|
|
|
411
411
|
@media (min-width:740px) {
|
|
@@ -958,7 +958,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
958
958
|
position: absolute;
|
|
959
959
|
-webkit-transition: left 0.15s ease-out;
|
|
960
960
|
transition: left 0.15s ease-out;
|
|
961
|
-
background-color: #
|
|
961
|
+
background-color: #2042AD;
|
|
962
962
|
left: 2px;
|
|
963
963
|
box-shadow: 0px 0px 16px rgba(0,0,0,0.3);
|
|
964
964
|
}
|
|
@@ -1007,7 +1007,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
1007
1007
|
}
|
|
1008
1008
|
|
|
1009
1009
|
.c8 input:focus:not(:checked) + label {
|
|
1010
|
-
box-shadow: inset 0 0 0 4px #
|
|
1010
|
+
box-shadow: inset 0 0 0 4px #2042AD;
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
1013
|
.c9 {
|
|
@@ -1046,7 +1046,7 @@ exports[`Monthly donation renders correctly 1`] = `
|
|
|
1046
1046
|
.c9:focus {
|
|
1047
1047
|
border: none;
|
|
1048
1048
|
outline: none;
|
|
1049
|
-
box-shadow: inset 0 0 0 4px #
|
|
1049
|
+
box-shadow: inset 0 0 0 4px #2042AD;
|
|
1050
1050
|
}
|
|
1051
1051
|
|
|
1052
1052
|
@media (min-width:740px) {
|
|
@@ -1426,7 +1426,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1426
1426
|
.c13 input:focus {
|
|
1427
1427
|
border: none;
|
|
1428
1428
|
outline: none;
|
|
1429
|
-
box-shadow: inset 0 0 0 4px #
|
|
1429
|
+
box-shadow: inset 0 0 0 4px #2042AD;
|
|
1430
1430
|
}
|
|
1431
1431
|
|
|
1432
1432
|
.c13 input:active:focus {
|
|
@@ -1447,7 +1447,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1447
1447
|
border-radius: 10px;
|
|
1448
1448
|
box-shadow: 0px 0px 16px rgba(0,0,0,0.15);
|
|
1449
1449
|
height: auto;
|
|
1450
|
-
background-color: #
|
|
1450
|
+
background-color: #2042AD;
|
|
1451
1451
|
box-shadow: 0px 0px 16px rgba(0,0,0,0.3);
|
|
1452
1452
|
color: #FFFFFF;
|
|
1453
1453
|
}
|
|
@@ -1455,7 +1455,7 @@ exports[`Single donation renders correctly 1`] = `
|
|
|
1455
1455
|
.c18 input:focus {
|
|
1456
1456
|
border: none;
|
|
1457
1457
|
outline: none;
|
|
1458
|
-
box-shadow: inset 0 0 0 4px #
|
|
1458
|
+
box-shadow: inset 0 0 0 4px #2042AD;
|
|
1459
1459
|
}
|
|
1460
1460
|
|
|
1461
1461
|
.c18 input:active:focus {
|
|
@@ -22,10 +22,10 @@ const EmailSignUp = ({
|
|
|
22
22
|
topCopy,
|
|
23
23
|
successCopy,
|
|
24
24
|
privacyCopy,
|
|
25
|
-
backgroundColour,
|
|
26
|
-
buttonColour,
|
|
25
|
+
backgroundColour = 'deep_violet_dark',
|
|
26
|
+
buttonColour = 'red',
|
|
27
27
|
formContext,
|
|
28
|
-
columnLayout,
|
|
28
|
+
columnLayout = false,
|
|
29
29
|
...rest
|
|
30
30
|
}) => {
|
|
31
31
|
const {
|
|
@@ -126,10 +126,4 @@ EmailSignUp.propTypes = {
|
|
|
126
126
|
columnLayout: PropTypes.bool
|
|
127
127
|
};
|
|
128
128
|
|
|
129
|
-
EmailSignUp.defaultProps = {
|
|
130
|
-
backgroundColour: 'deep_violet_dark',
|
|
131
|
-
buttonColour: 'red',
|
|
132
|
-
columnLayout: false
|
|
133
|
-
};
|
|
134
|
-
|
|
135
129
|
export { EmailSignUp, buildEsuValidationSchema, ESU_FIELDS };
|
|
@@ -7,9 +7,9 @@ import Input from '../../Atoms/Input/Input';
|
|
|
7
7
|
const TextInput = ({
|
|
8
8
|
fieldName,
|
|
9
9
|
label,
|
|
10
|
-
optional,
|
|
11
|
-
fieldType,
|
|
12
|
-
formContext,
|
|
10
|
+
optional = null,
|
|
11
|
+
fieldType = 'text',
|
|
12
|
+
formContext = null,
|
|
13
13
|
...rest
|
|
14
14
|
}) => {
|
|
15
15
|
const { formState: { errors }, register } = formContext;
|
|
@@ -28,12 +28,6 @@ const TextInput = ({
|
|
|
28
28
|
return <Input {...props} {...register(fieldName)} />;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
TextInput.defaultProps = {
|
|
32
|
-
optional: null,
|
|
33
|
-
fieldType: 'text',
|
|
34
|
-
formContext: null
|
|
35
|
-
};
|
|
36
|
-
|
|
37
31
|
TextInput.propTypes = {
|
|
38
32
|
fieldName: PropTypes.string.isRequired,
|
|
39
33
|
label: PropTypes.string.isRequired,
|
|
@@ -16,14 +16,14 @@ import {
|
|
|
16
16
|
} from './Footer.style';
|
|
17
17
|
|
|
18
18
|
const Footer = ({
|
|
19
|
-
navItems, footerCopy, campaign, additionalLegalLine, ...rest
|
|
19
|
+
navItems = {}, footerCopy = '', campaign = 'Comic Relief', additionalLegalLine = '', overrideallowList = false, ...rest
|
|
20
20
|
}) => {
|
|
21
21
|
// Remove white space between words
|
|
22
22
|
const campaignName = campaign.replace(/\s/g, '').toLowerCase();
|
|
23
23
|
|
|
24
24
|
return (
|
|
25
25
|
<div>
|
|
26
|
-
<FooterWrapper navItems {...rest}>
|
|
26
|
+
<FooterWrapper overrideallowList={overrideallowList} navItems {...rest}>
|
|
27
27
|
<InnerWrapper>
|
|
28
28
|
{additionalLegalLine
|
|
29
29
|
&& <FooterLegalLine tag="p" color="grey">{additionalLegalLine}</FooterLegalLine>
|
|
@@ -56,12 +56,4 @@ Footer.propTypes = {
|
|
|
56
56
|
additionalLegalLine: PropTypes.string
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
Footer.defaultProps = {
|
|
60
|
-
navItems: {},
|
|
61
|
-
footerCopy: '',
|
|
62
|
-
campaign: 'Comic Relief',
|
|
63
|
-
overrideallowList: false,
|
|
64
|
-
additionalLegalLine: ''
|
|
65
|
-
};
|
|
66
|
-
|
|
67
59
|
export default Footer;
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
SubNavLink
|
|
17
17
|
} from './Nav.style';
|
|
18
18
|
|
|
19
|
-
const FooterNav = ({ navItems, ...rest }) => {
|
|
19
|
+
const FooterNav = ({ navItems = {}, ...rest }) => {
|
|
20
20
|
const { menuGroups } = navItems;
|
|
21
21
|
const [isExpandable] = useState(false);
|
|
22
22
|
const [isSubMenuOpen, setIsSubMenuOpen] = useState({});
|
|
@@ -123,8 +123,4 @@ FooterNav.propTypes = {
|
|
|
123
123
|
navItems: PropTypes.objectOf(PropTypes.shape)
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
-
FooterNav.defaultProps = {
|
|
127
|
-
navItems: {}
|
|
128
|
-
};
|
|
129
|
-
|
|
130
126
|
export default FooterNav;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from './Header.style';
|
|
9
9
|
|
|
10
10
|
const Header = ({
|
|
11
|
-
navItems, metaIcons, campaign, ...rest
|
|
11
|
+
navItems = {}, metaIcons, campaign = 'Comic Relief', ...rest
|
|
12
12
|
}) => (
|
|
13
13
|
<HeaderWrapper navItems {...rest}>
|
|
14
14
|
<InnerWrapper>
|
|
@@ -29,9 +29,4 @@ Header.propTypes = {
|
|
|
29
29
|
campaign: PropTypes.string
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
Header.defaultProps = {
|
|
33
|
-
navItems: {},
|
|
34
|
-
campaign: 'Comic Relief'
|
|
35
|
-
};
|
|
36
|
-
|
|
37
32
|
export default Header;
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
ChevronWrapper
|
|
22
22
|
} from './Nav.style';
|
|
23
23
|
|
|
24
|
-
const MainNav = ({ navItems }) => {
|
|
24
|
+
const MainNav = ({ navItems = {} }) => {
|
|
25
25
|
const { menuGroups } = navItems;
|
|
26
26
|
const [isExpandable, setIsExpandable] = useState(false);
|
|
27
27
|
const [isSubMenuOpen, setIsSubMenuOpen] = useState({});
|
|
@@ -180,8 +180,4 @@ MainNav.propTypes = {
|
|
|
180
180
|
navItems: PropTypes.objectOf(PropTypes.shape)
|
|
181
181
|
};
|
|
182
182
|
|
|
183
|
-
MainNav.defaultProps = {
|
|
184
|
-
navItems: {}
|
|
185
|
-
};
|
|
186
|
-
|
|
187
183
|
export default MainNav;
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
|
|
12
12
|
const ImpactSlider = ({
|
|
13
13
|
heading, cartID, donateLink, rowID, items, step, max,
|
|
14
|
-
backgroundColour, opacityAnimation, children, defaultSliderValue
|
|
14
|
+
backgroundColour = 'grey_extra_light', opacityAnimation = false, children, defaultSliderValue = null
|
|
15
15
|
}) => {
|
|
16
16
|
// Use the lowest possible amount as our default:
|
|
17
17
|
const [currentAmount, setCurrentAmount] = useState(defaultSliderValue || step);
|
|
@@ -65,12 +65,6 @@ const ImpactSlider = ({
|
|
|
65
65
|
);
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
ImpactSlider.defaultProps = {
|
|
69
|
-
opacityAnimation: false,
|
|
70
|
-
defaultSliderValue: null,
|
|
71
|
-
backgroundColour: 'grey_extra_light'
|
|
72
|
-
};
|
|
73
|
-
|
|
74
68
|
ImpactSlider.propTypes = {
|
|
75
69
|
heading: PropTypes.string.isRequired,
|
|
76
70
|
children: PropTypes.node.isRequired,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from './MarketingPreferencesDS.style';
|
|
10
10
|
|
|
11
11
|
const CheckAnswer = ({
|
|
12
|
-
name, mpValidationOptions, userSelection, formContext
|
|
12
|
+
name, mpValidationOptions, userSelection = null, formContext = null
|
|
13
13
|
}) => {
|
|
14
14
|
const { setValue, clearErrors, register } = formContext;
|
|
15
15
|
|
|
@@ -63,11 +63,6 @@ const CheckAnswer = ({
|
|
|
63
63
|
);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
CheckAnswer.defaultProps = {
|
|
67
|
-
userSelection: null,
|
|
68
|
-
formContext: null
|
|
69
|
-
};
|
|
70
|
-
|
|
71
66
|
CheckAnswer.propTypes = {
|
|
72
67
|
name: PropTypes.string.isRequired,
|
|
73
68
|
/* These options are created in _MarketingPrefsConfig.js, passed to react-hook-form
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
} from './_MarketingPrefsConfig';
|
|
16
16
|
|
|
17
17
|
const MarketingPreferencesDS = ({
|
|
18
|
-
copyTop,
|
|
19
|
-
copyBottom,
|
|
18
|
+
copyTop = defaultCopyTop,
|
|
19
|
+
copyBottom = defaultCopyBottom,
|
|
20
20
|
mpValidationOptions,
|
|
21
|
-
id,
|
|
22
|
-
formContext
|
|
21
|
+
id = null,
|
|
22
|
+
formContext = null
|
|
23
23
|
}) => {
|
|
24
24
|
const { formState: { errors }, control } = formContext;
|
|
25
25
|
|
|
@@ -241,7 +241,7 @@ const MarketingPreferencesDS = ({
|
|
|
241
241
|
};
|
|
242
242
|
|
|
243
243
|
// removes from DOM completely
|
|
244
|
-
const MaybeDisabled = ({ children, disabled }) => {
|
|
244
|
+
const MaybeDisabled = ({ children = null, disabled = false }) => {
|
|
245
245
|
if (disabled) return null;
|
|
246
246
|
return children;
|
|
247
247
|
};
|
|
@@ -256,23 +256,11 @@ MarketingPreferencesDS.propTypes = {
|
|
|
256
256
|
formContext: PropTypes.shape()
|
|
257
257
|
};
|
|
258
258
|
|
|
259
|
-
MarketingPreferencesDS.defaultProps = {
|
|
260
|
-
copyTop: defaultCopyTop,
|
|
261
|
-
copyBottom: defaultCopyBottom,
|
|
262
|
-
id: null,
|
|
263
|
-
formContext: null
|
|
264
|
-
};
|
|
265
|
-
|
|
266
259
|
MaybeDisabled.propTypes = {
|
|
267
260
|
children: PropTypes.node,
|
|
268
261
|
disabled: PropTypes.bool
|
|
269
262
|
};
|
|
270
263
|
|
|
271
|
-
MaybeDisabled.defaultProps = {
|
|
272
|
-
children: null,
|
|
273
|
-
disabled: false
|
|
274
|
-
};
|
|
275
|
-
|
|
276
264
|
export {
|
|
277
265
|
MarketingPreferencesDS, setInitialValues, buildValidationSchema
|
|
278
266
|
};
|
|
@@ -4,7 +4,7 @@ import Input from '../../Atoms/Input/Input';
|
|
|
4
4
|
|
|
5
5
|
const TextInput = ({
|
|
6
6
|
fieldName, label,
|
|
7
|
-
optional, fieldType, formContext, ...rest
|
|
7
|
+
optional = null, fieldType = 'text', formContext = null, ...rest
|
|
8
8
|
}) => {
|
|
9
9
|
const { formState: { errors }, register } = formContext;
|
|
10
10
|
|
|
@@ -23,12 +23,6 @@ const TextInput = ({
|
|
|
23
23
|
return <Input {...props} {...register(fieldName)} />;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
TextInput.defaultProps = {
|
|
27
|
-
optional: null,
|
|
28
|
-
fieldType: 'text',
|
|
29
|
-
formContext: null
|
|
30
|
-
};
|
|
31
|
-
|
|
32
26
|
TextInput.propTypes = {
|
|
33
27
|
fieldName: PropTypes.string.isRequired,
|
|
34
28
|
label: PropTypes.string.isRequired,
|
|
@@ -27,7 +27,7 @@ const Signup = ({
|
|
|
27
27
|
data: { regularGiving },
|
|
28
28
|
donateLink,
|
|
29
29
|
otherDescription,
|
|
30
|
-
clientID,
|
|
30
|
+
clientID = 'the_fix',
|
|
31
31
|
cartID,
|
|
32
32
|
mbshipID,
|
|
33
33
|
...rest
|
|
@@ -204,8 +204,4 @@ Signup.propTypes = {
|
|
|
204
204
|
data: PropTypes.objectOf(PropTypes.shape)
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
-
Signup.defaultProps = {
|
|
208
|
-
clientID: 'the_fix',
|
|
209
|
-
data: {}
|
|
210
|
-
};
|
|
211
207
|
export default Signup;
|
|
@@ -8,19 +8,19 @@ import {
|
|
|
8
8
|
} from './Membership.style';
|
|
9
9
|
|
|
10
10
|
const Membership = ({
|
|
11
|
-
alt,
|
|
11
|
+
alt = '',
|
|
12
|
+
data = {},
|
|
13
|
+
formAligntRight = true,
|
|
14
|
+
imageLow = null,
|
|
15
|
+
image = null,
|
|
16
|
+
images = null,
|
|
17
|
+
backgroundColor = null,
|
|
18
|
+
mbshipID = null,
|
|
12
19
|
cartID,
|
|
13
|
-
backgroundColor,
|
|
14
20
|
donateLink,
|
|
15
|
-
data,
|
|
16
21
|
title,
|
|
17
22
|
subtitle,
|
|
18
|
-
otherDescription
|
|
19
|
-
formAligntRight,
|
|
20
|
-
images,
|
|
21
|
-
image,
|
|
22
|
-
imageLow,
|
|
23
|
-
mbshipID
|
|
23
|
+
otherDescription
|
|
24
24
|
}) => (
|
|
25
25
|
<Container
|
|
26
26
|
formAligntRight={formAligntRight}
|
|
@@ -72,14 +72,4 @@ Membership.propTypes = {
|
|
|
72
72
|
mbshipID: PropTypes.string
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
Membership.defaultProps = {
|
|
76
|
-
alt: '',
|
|
77
|
-
data: {},
|
|
78
|
-
formAligntRight: true,
|
|
79
|
-
imageLow: null,
|
|
80
|
-
image: null,
|
|
81
|
-
images: null,
|
|
82
|
-
backgroundColor: null,
|
|
83
|
-
mbshipID: null
|
|
84
|
-
};
|
|
85
75
|
export default Membership;
|
|
@@ -24,9 +24,9 @@ const MoneyBox = styled(Input)`
|
|
|
24
24
|
|
|
25
25
|
const MoneyBuy = ({
|
|
26
26
|
setOtherAmount,
|
|
27
|
-
amount,
|
|
28
|
-
currency,
|
|
29
|
-
description,
|
|
27
|
+
amount = '10',
|
|
28
|
+
currency = '£',
|
|
29
|
+
description = 'description',
|
|
30
30
|
...rest
|
|
31
31
|
}) => (
|
|
32
32
|
<MoneyBox
|
|
@@ -48,10 +48,4 @@ MoneyBuy.propTypes = {
|
|
|
48
48
|
setOtherAmount: PropTypes.func.isRequired
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
MoneyBuy.defaultProps = {
|
|
52
|
-
amount: '10',
|
|
53
|
-
currency: '£',
|
|
54
|
-
description: 'description'
|
|
55
|
-
};
|
|
56
|
-
|
|
57
51
|
export default MoneyBuy;
|