@comicrelief/component-library 7.0.0 → 7.0.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/cypress/integration/components/Organisms/Donate.spec.js +28 -28
- package/cypress/integration/components/Organisms/Membership.spec.js +118 -120
- package/dist/components/Organisms/Donate/Donate.md +9 -9
- package/dist/components/Organisms/Donate/Form/Form.js +8 -6
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +17 -71
- package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +71 -0
- package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +14 -28
- package/dist/components/Organisms/EmailSignUp/EmailSignUpForm.js +1 -0
- package/dist/components/Organisms/Membership/Form/Form.js +4 -3
- package/dist/components/Organisms/Membership/Membership.test.js +1 -1
- package/dist/utils/Membership.js +1 -1
- package/package.json +1 -1
- package/src/components/Organisms/Donate/Donate.md +9 -9
- package/src/components/Organisms/Donate/Form/Form.js +11 -7
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.js +15 -85
- package/src/components/Organisms/Donate/GivingSelector/GivingSelector.style.js +78 -0
- package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +14 -28
- package/src/components/Organisms/EmailSignUp/EmailSignUpForm.js +1 -0
- package/src/components/Organisms/Membership/Form/Form.js +3 -3
- package/src/components/Organisms/Membership/Membership.test.js +1 -1
- package/src/utils/Membership.js +1 -1
|
@@ -49,10 +49,10 @@ describe('Donate component', () => {
|
|
|
49
49
|
it('renders donate form align right preview', () => {
|
|
50
50
|
// monthly
|
|
51
51
|
cy.get('@container')
|
|
52
|
-
.find('label[for="give-once"]')
|
|
52
|
+
.find('label[for="give-once--mship-1"]')
|
|
53
53
|
.contains('Single');
|
|
54
54
|
cy.get('@container')
|
|
55
|
-
.find('label[for="give-monthly"]')
|
|
55
|
+
.find('label[for="give-monthly--mship-1"]')
|
|
56
56
|
.contains('Monthly')
|
|
57
57
|
.click();
|
|
58
58
|
cy.get('@container')
|
|
@@ -67,14 +67,14 @@ describe('Donate component', () => {
|
|
|
67
67
|
.clear()
|
|
68
68
|
.type(' ');
|
|
69
69
|
cy.get('@container')
|
|
70
|
-
.find('p
|
|
71
|
-
.contains('Please enter an amount between £1 and £
|
|
70
|
+
.find('p.error--amount')
|
|
71
|
+
.contains('Please enter an amount between £1 and £25000 and up to 2 decimal places');
|
|
72
72
|
cy.get('@container')
|
|
73
73
|
.find('[id="mship-1--MoneyBuy-userInput"]')
|
|
74
74
|
.type('15.999');
|
|
75
75
|
cy.get('@container')
|
|
76
|
-
.find('p
|
|
77
|
-
.contains('Please enter an amount between £1 and £
|
|
76
|
+
.find('p.error--amount')
|
|
77
|
+
.contains('Please enter an amount between £1 and £25000 and up to 2 decimal places');
|
|
78
78
|
cy.get('@container')
|
|
79
79
|
.find('form > fieldset > input')
|
|
80
80
|
.contains('Donate monthly');
|
|
@@ -114,29 +114,29 @@ describe('Donate component', () => {
|
|
|
114
114
|
|
|
115
115
|
it('renders donate form align left preview', () => {
|
|
116
116
|
cy.get('@container')
|
|
117
|
-
.find('label[for="give-once"]')
|
|
117
|
+
.find('label[for="give-once--mship-2"]')
|
|
118
118
|
.contains('Single');
|
|
119
119
|
cy.get('@container')
|
|
120
|
-
.find('label[for="give-monthly"]')
|
|
120
|
+
.find('label[for="give-monthly--mship-2"]')
|
|
121
121
|
.contains('Monthly');
|
|
122
122
|
cy.get('@container')
|
|
123
|
-
.find('#mship-
|
|
123
|
+
.find('#mship-2--moneyBuy-box2')
|
|
124
124
|
.should('exist')
|
|
125
125
|
.click();
|
|
126
126
|
cy.get('@container')
|
|
127
|
-
.find('[id="mship-
|
|
127
|
+
.find('[id="mship-2--MoneyBuy-userInput"]')
|
|
128
128
|
.should('have.value', '20')
|
|
129
129
|
.clear()
|
|
130
130
|
.type(' ');
|
|
131
131
|
cy.get('@container')
|
|
132
|
-
.find('p
|
|
133
|
-
.contains('Please enter an amount between £1 and £
|
|
132
|
+
.find('p.error--amount')
|
|
133
|
+
.contains('Please enter an amount between £1 and £25000 and up to 2 decimal places');
|
|
134
134
|
cy.get('@container')
|
|
135
|
-
.find('[id="mship-
|
|
135
|
+
.find('[id="mship-2--MoneyBuy-userInput"]')
|
|
136
136
|
.type('10.999');
|
|
137
137
|
cy.get('@container')
|
|
138
|
-
.find('p
|
|
139
|
-
.should('contain', 'Please enter an amount between £1 and £
|
|
138
|
+
.find('p.error--amount')
|
|
139
|
+
.should('contain', 'Please enter an amount between £1 and £25000 and up to 2 decimal places');
|
|
140
140
|
cy.get('@container')
|
|
141
141
|
.find('form > fieldset > input')
|
|
142
142
|
.contains('Donate now');
|
|
@@ -179,25 +179,25 @@ describe('Donate component', () => {
|
|
|
179
179
|
.find('label[for="give-once"]')
|
|
180
180
|
.should('not.exist');
|
|
181
181
|
cy.get('@container')
|
|
182
|
-
.find('#mship-
|
|
182
|
+
.find('#mship-3--moneyBuy-box3')
|
|
183
183
|
.should('exist')
|
|
184
184
|
.click();
|
|
185
185
|
cy.get('@container')
|
|
186
|
-
.find('[id="mship-
|
|
186
|
+
.find('[id="mship-3--MoneyBuy-userInput"]')
|
|
187
187
|
.should('have.value', '30')
|
|
188
188
|
.clear()
|
|
189
189
|
.type('10.99')
|
|
190
190
|
.clear()
|
|
191
191
|
.type(' ');
|
|
192
192
|
cy.get('@container')
|
|
193
|
-
.find('p
|
|
194
|
-
.contains('Please enter an amount between £1 and £
|
|
193
|
+
.find('p.error--amount')
|
|
194
|
+
.contains('Please enter an amount between £1 and £25000 and up to 2 decimal places');
|
|
195
195
|
cy.get('@container')
|
|
196
|
-
.find('[id="mship-
|
|
196
|
+
.find('[id="mship-3--MoneyBuy-userInput"]')
|
|
197
197
|
.type('10.999');
|
|
198
198
|
cy.get('@container')
|
|
199
|
-
.find('p
|
|
200
|
-
.contains('Please enter an amount between £1 and £
|
|
199
|
+
.find('p.error--amount')
|
|
200
|
+
.contains('Please enter an amount between £1 and £25000 and up to 2 decimal places');
|
|
201
201
|
cy.get('@container')
|
|
202
202
|
.find('form > fieldset > input')
|
|
203
203
|
.contains('Donate now');
|
|
@@ -240,23 +240,23 @@ describe('Donate component', () => {
|
|
|
240
240
|
.find('label[for="give-once"]')
|
|
241
241
|
.should('not.exist');
|
|
242
242
|
cy.get('@container')
|
|
243
|
-
.find('#mship-
|
|
243
|
+
.find('#mship-4--moneyBuy-box1')
|
|
244
244
|
.should('not.exist');
|
|
245
245
|
cy.get('@container')
|
|
246
|
-
.find('[id="mship-
|
|
246
|
+
.find('[id="mship-4--MoneyBuy-userInput"]')
|
|
247
247
|
.should('exist')
|
|
248
248
|
.clear()
|
|
249
249
|
.type('5')
|
|
250
250
|
.clear();
|
|
251
251
|
cy.get('@container')
|
|
252
|
-
.find('p
|
|
253
|
-
.contains('Please enter an amount between £1 and £
|
|
252
|
+
.find('p.error--amount')
|
|
253
|
+
.contains('Please enter an amount between £1 and £25000 and up to 2 decimal places');
|
|
254
254
|
cy.get('@container')
|
|
255
|
-
.find('[id="mship-
|
|
255
|
+
.find('[id="mship-4--MoneyBuy-userInput"]')
|
|
256
256
|
.type('10.999')
|
|
257
257
|
.clear()
|
|
258
258
|
.type('5')
|
|
259
|
-
.should('not.have', 'Please enter an amount between £1 and £
|
|
259
|
+
.should('not.have', 'Please enter an amount between £1 and £250000 and up to 2 decimal places');
|
|
260
260
|
cy.get('@container')
|
|
261
261
|
.find('form > fieldset > input')
|
|
262
262
|
.contains('Donate');
|
|
@@ -1,129 +1,127 @@
|
|
|
1
1
|
describe('Membership component', () => {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
before(() => {
|
|
3
|
+
// go to membership component
|
|
4
|
+
cy.visit('/#membership');
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
describe('props and methods section', () => {
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
cy.get('[data-testid="Membership-container"] button[name="rsg-usage"]')
|
|
10
|
+
.contains('Props & methods')
|
|
11
|
+
.as('propsBtn');
|
|
12
|
+
|
|
13
|
+
cy.get('@propsBtn')
|
|
14
|
+
.closest('[class^=rsg--tabs]')
|
|
15
|
+
.as('container');
|
|
5
16
|
});
|
|
6
17
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
cy.get('[data-testid="Membership-container"] button[name="rsg-usage"]')
|
|
10
|
-
.contains('Props & methods')
|
|
11
|
-
.as('propsBtn');
|
|
12
|
-
|
|
13
|
-
cy.get('@propsBtn')
|
|
14
|
-
.closest('[class^=rsg--tabs]')
|
|
15
|
-
.as('container');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('is present', () => {
|
|
19
|
-
cy.get('@propsBtn').should('exist');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('does not show table initially', () => {
|
|
23
|
-
cy.get('@container')
|
|
24
|
-
.find('table')
|
|
25
|
-
.should('not.exist');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('shows the table on button click', () => {
|
|
29
|
-
cy.get('@propsBtn').click();
|
|
30
|
-
cy.get('@container')
|
|
31
|
-
.find('table')
|
|
32
|
-
.should('contain', 'Prop name');
|
|
33
|
-
});
|
|
18
|
+
it('is present', () => {
|
|
19
|
+
cy.get('@propsBtn').should('exist');
|
|
34
20
|
});
|
|
35
21
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
.find('[data-preview="Membership"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders Membership form align right preview', () => {
|
|
50
|
-
|
|
51
|
-
cy.get('@container')
|
|
52
|
-
.find('input[id="mship-1--moneyBuy-box1"]')
|
|
53
|
-
.should('exist');
|
|
54
|
-
cy.get('@container')
|
|
55
|
-
.find('input[id="mship-1--MoneyBuy-userInput"]')
|
|
56
|
-
.type('20001');
|
|
57
|
-
cy.get('@container')
|
|
58
|
-
.find('p')
|
|
59
|
-
.contains('Please enter a number between 1 and 20000, and up to 2 decimal places')
|
|
60
|
-
cy.get('@container')
|
|
61
|
-
.find('input[id="mship-1--MoneyBuy-userInput"]')
|
|
62
|
-
.type('1')
|
|
63
|
-
.get('input[type="submit"]')
|
|
64
|
-
.should('exist')
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('has view code button', () => {
|
|
68
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('shows code on click', () => {
|
|
72
|
-
cy.get('@viewCodeBtn').click();
|
|
73
|
-
cy.get('@container')
|
|
74
|
-
.find('textarea')
|
|
75
|
-
.should('exist');
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('closes code on click', () => {
|
|
79
|
-
cy.get('@viewCodeBtn').click();
|
|
80
|
-
});
|
|
22
|
+
it('does not show table initially', () => {
|
|
23
|
+
cy.get('@container')
|
|
24
|
+
.find('table')
|
|
25
|
+
.should('not.exist');
|
|
81
26
|
});
|
|
82
27
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
.as('preview');
|
|
89
|
-
|
|
90
|
-
cy.get('@container')
|
|
91
|
-
.find('button')
|
|
92
|
-
.contains('View Code')
|
|
93
|
-
.as('viewCodeBtn');
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('renders Membership form align left preview', () => {
|
|
97
|
-
|
|
98
|
-
cy.get('@container')
|
|
99
|
-
.find('input[id="mship-1--moneyBuy-box3"]')
|
|
100
|
-
.should('exist');
|
|
101
|
-
cy.get('@container')
|
|
102
|
-
.find('input[id="mship-1--MoneyBuy-userInput"]')
|
|
103
|
-
.type('20001');
|
|
104
|
-
cy.get('@container')
|
|
105
|
-
.find('p')
|
|
106
|
-
.contains('Please enter a number between 1 and 20000, and up to 2 decimal places');
|
|
107
|
-
cy.get('@container')
|
|
108
|
-
.find('input[id="mship-1--MoneyBuy-userInput"]')
|
|
109
|
-
.type('1')
|
|
110
|
-
.get('input[type="submit"]')
|
|
111
|
-
.should('exist')
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('has view code button', () => {
|
|
115
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
it('shows code on click', () => {
|
|
119
|
-
cy.get('@viewCodeBtn').click();
|
|
120
|
-
cy.get('@container')
|
|
121
|
-
.find('textarea')
|
|
122
|
-
.should('exist');
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it('closes code on click', () => {
|
|
126
|
-
cy.get('@viewCodeBtn').click();
|
|
127
|
-
});
|
|
28
|
+
it('shows the table on button click', () => {
|
|
29
|
+
cy.get('@propsBtn').click();
|
|
30
|
+
cy.get('@container')
|
|
31
|
+
.find('table')
|
|
32
|
+
.should('contain', 'Prop name');
|
|
128
33
|
});
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('Membership form align right section', () => {
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
cy.get('[data-testid="Membership-example-1"]')
|
|
39
|
+
.as('container')
|
|
40
|
+
.find('[data-preview="Membership"]')
|
|
41
|
+
.as('preview');
|
|
42
|
+
|
|
43
|
+
cy.get('@container')
|
|
44
|
+
.find('button')
|
|
45
|
+
.contains('View Code')
|
|
46
|
+
.as('viewCodeBtn');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('renders Membership form align right preview', () => {
|
|
50
|
+
cy.get('@container')
|
|
51
|
+
.find('input[id="mship-1--moneyBuy-box1"]')
|
|
52
|
+
.should('exist');
|
|
53
|
+
cy.get('@container')
|
|
54
|
+
.find('input[id="mship-1--MoneyBuy-userInput"]')
|
|
55
|
+
.type('25001');
|
|
56
|
+
cy.get('@container')
|
|
57
|
+
.find('p.error--amount')
|
|
58
|
+
.contains('Please enter a number between 1 and 25000, and up to 2 decimal places');
|
|
59
|
+
cy.get('@container')
|
|
60
|
+
.find('input[id="mship-1--MoneyBuy-userInput"]')
|
|
61
|
+
.type('1')
|
|
62
|
+
.get('input[type="submit"]')
|
|
63
|
+
.should('exist');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
it('has view code button', () => {
|
|
67
|
+
cy.get('@viewCodeBtn').should('exist');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('shows code on click', () => {
|
|
71
|
+
cy.get('@viewCodeBtn').click();
|
|
72
|
+
cy.get('@container')
|
|
73
|
+
.find('textarea')
|
|
74
|
+
.should('exist');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('closes code on click', () => {
|
|
78
|
+
cy.get('@viewCodeBtn').click();
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe('Membership form align left section', () => {
|
|
83
|
+
beforeEach(() => {
|
|
84
|
+
cy.get('[data-testid="Membership-example-3"]')
|
|
85
|
+
.as('container')
|
|
86
|
+
.find('[data-preview="Membership"]')
|
|
87
|
+
.as('preview');
|
|
88
|
+
|
|
89
|
+
cy.get('@container')
|
|
90
|
+
.find('button')
|
|
91
|
+
.contains('View Code')
|
|
92
|
+
.as('viewCodeBtn');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('renders Membership form align left preview', () => {
|
|
96
|
+
cy.get('@container')
|
|
97
|
+
.find('input[id="mship-1--moneyBuy-box3"]')
|
|
98
|
+
.should('exist');
|
|
99
|
+
cy.get('@container')
|
|
100
|
+
.find('input[id="mship-1--MoneyBuy-userInput"]')
|
|
101
|
+
.type('25001');
|
|
102
|
+
cy.get('@container')
|
|
103
|
+
.find('p.error--amount')
|
|
104
|
+
.contains('Please enter a number between 1 and 25000, and up to 2 decimal places');
|
|
105
|
+
cy.get('@container')
|
|
106
|
+
.find('input[id="mship-1--MoneyBuy-userInput"]')
|
|
107
|
+
.type('1')
|
|
108
|
+
.get('input[type="submit"]')
|
|
109
|
+
.should('exist');
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('has view code button', () => {
|
|
113
|
+
cy.get('@viewCodeBtn').should('exist');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('shows code on click', () => {
|
|
117
|
+
cy.get('@viewCodeBtn').click();
|
|
118
|
+
cy.get('@container')
|
|
119
|
+
.find('textarea')
|
|
120
|
+
.should('exist');
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('closes code on click', () => {
|
|
124
|
+
cy.get('@viewCodeBtn').click();
|
|
125
|
+
});
|
|
126
|
+
});
|
|
129
127
|
});
|
|
@@ -41,7 +41,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
41
41
|
mobileImageLow={mobilePictures.imageLow}
|
|
42
42
|
mobileImages={mobilePictures.images}
|
|
43
43
|
data={data}
|
|
44
|
-
mbshipID="mship-
|
|
44
|
+
mbshipID="mship-2"
|
|
45
45
|
donateLink="https://donation.comicrelief.com/"
|
|
46
46
|
clientID="donate"
|
|
47
47
|
cartID="default-comicrelief"
|
|
@@ -66,7 +66,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
66
66
|
mobileImageLow={mobilePictures.imageLow}
|
|
67
67
|
mobileImages={mobilePictures.images}
|
|
68
68
|
data={data}
|
|
69
|
-
mbshipID="mship-
|
|
69
|
+
mbshipID="mship-3"
|
|
70
70
|
donateLink="https://donation.comicrelief.com/"
|
|
71
71
|
clientID="donate"
|
|
72
72
|
cartID="default-comicrelief"
|
|
@@ -91,7 +91,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
91
91
|
mobileImageLow={mobilePictures.imageLow}
|
|
92
92
|
mobileImages={mobilePictures.images}
|
|
93
93
|
data={data}
|
|
94
|
-
mbshipID="mship-
|
|
94
|
+
mbshipID="mship-4"
|
|
95
95
|
donateLink="https://donation.comicrelief.com/"
|
|
96
96
|
clientID="donate"
|
|
97
97
|
cartID="default-comicrelief"
|
|
@@ -118,7 +118,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
118
118
|
mobileImageLow={mobilePictures.imageLow}
|
|
119
119
|
mobileImages={mobilePictures.images}
|
|
120
120
|
data={data}
|
|
121
|
-
mbshipID="mship-
|
|
121
|
+
mbshipID="mship-5"
|
|
122
122
|
donateLink="https://donation.comicrelief.com/"
|
|
123
123
|
clientID="donate"
|
|
124
124
|
cartID="default-comicrelief"
|
|
@@ -143,7 +143,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
143
143
|
mobileImageLow={mobilePictures.imageLow}
|
|
144
144
|
mobileImages={mobilePictures.images}
|
|
145
145
|
data={data}
|
|
146
|
-
mbshipID="mship-
|
|
146
|
+
mbshipID="mship-6"
|
|
147
147
|
donateLink="https://donation.comicrelief.com/"
|
|
148
148
|
clientID="donate"
|
|
149
149
|
cartID="default-comicrelief"
|
|
@@ -168,7 +168,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
168
168
|
mobileImageLow={mobilePictures.imageLow}
|
|
169
169
|
mobileImages={mobilePictures.images}
|
|
170
170
|
data={data}
|
|
171
|
-
mbshipID="mship-
|
|
171
|
+
mbshipID="mship-7"
|
|
172
172
|
donateLink="https://donation.comicrelief.com/"
|
|
173
173
|
clientID="donate"
|
|
174
174
|
cartID="default-comicrelief"
|
|
@@ -193,7 +193,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
193
193
|
mobileImageLow={mobilePictures.imageLow}
|
|
194
194
|
mobileImages={mobilePictures.images}
|
|
195
195
|
data={data}
|
|
196
|
-
mbshipID="mship-
|
|
196
|
+
mbshipID="mship-8"
|
|
197
197
|
donateLink="https://donation.comicrelief.com/"
|
|
198
198
|
clientID="donate"
|
|
199
199
|
cartID="default-comicrelief"
|
|
@@ -213,7 +213,7 @@ import data from './dev-data/data-single';
|
|
|
213
213
|
backgroundColor="blue_dark"
|
|
214
214
|
formAlignRight={false}
|
|
215
215
|
data={data}
|
|
216
|
-
mbshipID="mship-
|
|
216
|
+
mbshipID="mship-9"
|
|
217
217
|
donateLink="https://donation.comicrelief.com/"
|
|
218
218
|
clientID="donate"
|
|
219
219
|
cartID="default-comicrelief"
|
|
@@ -241,7 +241,7 @@ const desktopPictures = require('../../../styleguide/data/data').defaultData;
|
|
|
241
241
|
mobileImageLow={mobilePictures.imageLow}
|
|
242
242
|
mobileImages={mobilePictures.images}
|
|
243
243
|
data={data}
|
|
244
|
-
mbshipID="mship-
|
|
244
|
+
mbshipID="mship-10"
|
|
245
245
|
donateLink="https://donation.comicrelief.com/"
|
|
246
246
|
clientID="donate"
|
|
247
247
|
cartID="default-comicrelief"
|
|
@@ -118,7 +118,8 @@ var Signup = function Signup(_ref) {
|
|
|
118
118
|
changeGivingType: function changeGivingType(data) {
|
|
119
119
|
return setGivingType(data);
|
|
120
120
|
},
|
|
121
|
-
setPopOpen: setPopOpen
|
|
121
|
+
setPopOpen: setPopOpen,
|
|
122
|
+
mbshipID: mbshipID
|
|
122
123
|
}), popOpen && /*#__PURE__*/_react.default.createElement(_PopUpComponent.default, {
|
|
123
124
|
PopUpText: PopUpText
|
|
124
125
|
}), /*#__PURE__*/_react.default.createElement(_Donate.Form, {
|
|
@@ -155,7 +156,7 @@ var Signup = function Signup(_ref) {
|
|
|
155
156
|
id: "".concat(mbshipID, "--MoneyBuy-userInput"),
|
|
156
157
|
showLabel: true
|
|
157
158
|
}, rest, {
|
|
158
|
-
max: "
|
|
159
|
+
max: "25000",
|
|
159
160
|
min: "1",
|
|
160
161
|
value: amountDonate,
|
|
161
162
|
pattern: "[^[0-9]+([,.][0-9]+)?$]",
|
|
@@ -166,7 +167,10 @@ var Signup = function Signup(_ref) {
|
|
|
166
167
|
"aria-label": "Input a different amount"
|
|
167
168
|
}))), amountDonate >= 1 && !noMoneyBuys && moneyBuyCopy && /*#__PURE__*/_react.default.createElement(_Donate.Copy, {
|
|
168
169
|
as: "p"
|
|
169
|
-
}, /*#__PURE__*/_react.default.createElement("strong", null, "\xA3".concat(amountDonate.toFixed(2), " ")), moneyBuyCopy),
|
|
170
|
+
}, /*#__PURE__*/_react.default.createElement("strong", null, "\xA3".concat(amountDonate.toFixed(2), " ")), moneyBuyCopy), errorMsg && /*#__PURE__*/_react.default.createElement(_Donate.Error, {
|
|
171
|
+
className: "error--amount",
|
|
172
|
+
tag: "p"
|
|
173
|
+
}, "Please enter an amount between \xA31 and \xA325000 and up to 2 decimal places"), noMoneyBuys ? /*#__PURE__*/_react.default.createElement(_Donate.Button, {
|
|
170
174
|
type: "submit",
|
|
171
175
|
as: "input",
|
|
172
176
|
value: "Donate"
|
|
@@ -174,9 +178,7 @@ var Signup = function Signup(_ref) {
|
|
|
174
178
|
type: "submit",
|
|
175
179
|
as: "input",
|
|
176
180
|
value: givingType === 'single' ? 'Donate now' : 'Donate monthly'
|
|
177
|
-
})
|
|
178
|
-
tag: "p"
|
|
179
|
-
}, "Please enter an amount between \xA31 and \xA320000 and up to 2 decimal places"))));
|
|
181
|
+
}))));
|
|
180
182
|
};
|
|
181
183
|
|
|
182
184
|
Signup.defaultProps = {
|
|
@@ -9,72 +9,17 @@ exports.default = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var Switch = _styledComponents.default.span.withConfig({
|
|
23
|
-
displayName: "GivingSelector__Switch",
|
|
24
|
-
componentId: "sc-haox9c-0"
|
|
25
|
-
})(["width:50%;height:48px;border-radius:2rem;", ";display:block;position:absolute;transition:left 0.15s ease-out;background-color:", ";left:2px;box-shadow:0px 0px 16px rgba(0,0,0,0.3);"], (0, _zIndex.default)('low'), function (_ref) {
|
|
26
|
-
var theme = _ref.theme;
|
|
27
|
-
return theme.color('blue');
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
var Wrapper = _styledComponents.default.div.withConfig({
|
|
31
|
-
displayName: "GivingSelector__Wrapper",
|
|
32
|
-
componentId: "sc-haox9c-1"
|
|
33
|
-
})(["display:flex;margin:", " 0;"], (0, _spacing.default)('md'));
|
|
34
|
-
|
|
35
|
-
var MoneyBox = _styledComponents.default.div.withConfig({
|
|
36
|
-
displayName: "GivingSelector__MoneyBox",
|
|
37
|
-
componentId: "sc-haox9c-2"
|
|
38
|
-
})(["width:100%;padding:2px;position:relative;display:flex;flex-direction:row;margin:", " 0;border-radius:2rem;background:", ";", "{width:450px;margin:0 auto;}#give-monthly:checked ~ ", "{left:calc(50% - 2px);}input{", "}input:focus:not(:checked) + label{box-shadow:inset 0 0 0 4px ", ";}"], (0, _spacing.default)('md'), function (_ref2) {
|
|
39
|
-
var theme = _ref2.theme;
|
|
40
|
-
return theme.color('blue_light');
|
|
41
|
-
}, (0, _size.media)('small'), Switch, _hideVisually.default, function (_ref3) {
|
|
42
|
-
var theme = _ref3.theme;
|
|
43
|
-
return theme.color('blue');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
var Label = _styledComponents.default.label.withConfig({
|
|
47
|
-
displayName: "GivingSelector__Label",
|
|
48
|
-
componentId: "sc-haox9c-3"
|
|
49
|
-
})(["font-size:", ";font-family:", ";font-weight:bold;min-height:48px;align-items:center;justify-content:center;display:flex;flex-basis:50%;border:none;transition:color 0.15s ease-out;", ";cursor:", ";&:active:focus{box-shadow:none;}&:focus{border:none;outline:none;box-shadow:inset 0 0 0 4px ", ";}&[for='give-once']{border-radius:2rem;color:", ";}&[for='give-monthly']{border-radius:2rem;color:", ";}"], function (_ref4) {
|
|
50
|
-
var theme = _ref4.theme;
|
|
51
|
-
return theme.fontSize('s');
|
|
52
|
-
}, function (_ref5) {
|
|
53
|
-
var theme = _ref5.theme;
|
|
54
|
-
return theme.fontFamilies('Montserrat');
|
|
55
|
-
}, (0, _zIndex.default)('medium'), function (_ref6) {
|
|
56
|
-
var active = _ref6.active;
|
|
57
|
-
return active === true ? 'default' : 'pointer';
|
|
58
|
-
}, function (_ref7) {
|
|
59
|
-
var theme = _ref7.theme;
|
|
60
|
-
return theme.color('blue');
|
|
61
|
-
}, function (_ref8) {
|
|
62
|
-
var active = _ref8.active,
|
|
63
|
-
theme = _ref8.theme;
|
|
64
|
-
return active === true ? theme.color('white') : theme.color('black');
|
|
65
|
-
}, function (_ref9) {
|
|
66
|
-
var active = _ref9.active,
|
|
67
|
-
theme = _ref9.theme;
|
|
68
|
-
return active === true ? theme.color('white') : theme.color('black');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
var GivingSelector = function GivingSelector(_ref10) {
|
|
72
|
-
var givingType = _ref10.givingType,
|
|
73
|
-
changeGivingType = _ref10.changeGivingType,
|
|
74
|
-
setPopOpen = _ref10.setPopOpen;
|
|
75
|
-
return /*#__PURE__*/_react.default.createElement(Wrapper, null, /*#__PURE__*/_react.default.createElement(MoneyBox, null, /*#__PURE__*/_react.default.createElement("input", {
|
|
12
|
+
var _GivingSelector = require("./GivingSelector.style");
|
|
13
|
+
|
|
14
|
+
var GivingSelector = function GivingSelector(_ref) {
|
|
15
|
+
var givingType = _ref.givingType,
|
|
16
|
+
changeGivingType = _ref.changeGivingType,
|
|
17
|
+
setPopOpen = _ref.setPopOpen,
|
|
18
|
+
mbshipID = _ref.mbshipID;
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement(_GivingSelector.Wrapper, null, /*#__PURE__*/_react.default.createElement(_GivingSelector.MoneyBox, null, /*#__PURE__*/_react.default.createElement("input", {
|
|
20
|
+
className: "give-once",
|
|
76
21
|
"aria-label": "Single",
|
|
77
|
-
id: "give-once",
|
|
22
|
+
id: "give-once--".concat(mbshipID),
|
|
78
23
|
value: "Single",
|
|
79
24
|
type: "radio",
|
|
80
25
|
label: "",
|
|
@@ -84,12 +29,13 @@ var GivingSelector = function GivingSelector(_ref10) {
|
|
|
84
29
|
changeGivingType('single');
|
|
85
30
|
setPopOpen(true);
|
|
86
31
|
}
|
|
87
|
-
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
32
|
+
}), /*#__PURE__*/_react.default.createElement(_GivingSelector.Label, {
|
|
88
33
|
active: givingType === 'single',
|
|
89
|
-
htmlFor: "give-once"
|
|
34
|
+
htmlFor: "give-once--".concat(mbshipID)
|
|
90
35
|
}, "Single"), /*#__PURE__*/_react.default.createElement("input", {
|
|
36
|
+
className: "give-monthly",
|
|
91
37
|
"aria-label": "Monthly",
|
|
92
|
-
id: "give-monthly",
|
|
38
|
+
id: "give-monthly--".concat(mbshipID),
|
|
93
39
|
value: "Monthly",
|
|
94
40
|
type: "radio",
|
|
95
41
|
label: "",
|
|
@@ -99,10 +45,10 @@ var GivingSelector = function GivingSelector(_ref10) {
|
|
|
99
45
|
changeGivingType('monthly');
|
|
100
46
|
setPopOpen(false);
|
|
101
47
|
}
|
|
102
|
-
}), /*#__PURE__*/_react.default.createElement(Label, {
|
|
48
|
+
}), /*#__PURE__*/_react.default.createElement(_GivingSelector.Label, {
|
|
103
49
|
active: givingType === 'monthly',
|
|
104
|
-
htmlFor: "give-monthly"
|
|
105
|
-
}, "Monthly"), /*#__PURE__*/_react.default.createElement(Switch, null)));
|
|
50
|
+
htmlFor: "give-monthly--".concat(mbshipID)
|
|
51
|
+
}, "Monthly"), /*#__PURE__*/_react.default.createElement(_GivingSelector.Switch, null)));
|
|
106
52
|
};
|
|
107
53
|
|
|
108
54
|
var _default = GivingSelector;
|