@comicrelief/component-library 7.35.6 → 7.35.8
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/components/Organisms/WYMDCarousel/_utils.js +3 -3
- package/dist/styleguide/data/data.js +64 -106
- package/package.json +1 -1
- package/src/components/Organisms/WYMDCarousel/WYMDCarousel.js +27 -48
- package/src/components/Organisms/WYMDCarousel/_utils.js +3 -3
- package/src/styleguide/data/data.js +64 -106
|
@@ -9,7 +9,7 @@ const formatItems = thisData => {
|
|
|
9
9
|
const allValidNodes = [];
|
|
10
10
|
|
|
11
11
|
// Set at a Content Type field level, so doesn't need to be dynamic:
|
|
12
|
-
const possibleNumberOfNodes =
|
|
12
|
+
const possibleNumberOfNodes = 9;
|
|
13
13
|
|
|
14
14
|
// Grab ALL keys from our raw data:
|
|
15
15
|
const theseKeys = Object.keys(thisData);
|
|
@@ -19,7 +19,7 @@ const formatItems = thisData => {
|
|
|
19
19
|
for (let i = 1; i <= possibleNumberOfNodes; i += 1) {
|
|
20
20
|
// Create a dynamic key prefix based on the counter, obviously matching
|
|
21
21
|
// the naming convention set at the Content Type level in the CMS
|
|
22
|
-
const thisKeyPrefix = "node".concat(i
|
|
22
|
+
const thisKeyPrefix = "node".concat(i);
|
|
23
23
|
|
|
24
24
|
// Make an array of objects, each object representing a specific node and its fields:
|
|
25
25
|
const thisNodeContent = theseKeys.filter(key => key.includes(thisKeyPrefix)).reduce((thisObj, thisKey) => {
|
|
@@ -27,7 +27,7 @@ const formatItems = thisData => {
|
|
|
27
27
|
// Only assign if we have actually have a value; only the fields for nodes 1-4 are required:
|
|
28
28
|
if (thisData[thisKey]) {
|
|
29
29
|
// Use a repeatable, generic key so rendering is a LOT easier:
|
|
30
|
-
const simplifedKey = thisKey.split(
|
|
30
|
+
const simplifedKey = thisKey.split(/([0-9])/).pop().toLowerCase();
|
|
31
31
|
thisFilteredObj[simplifedKey] = thisData[thisKey];
|
|
32
32
|
}
|
|
33
33
|
return thisFilteredObj;
|
|
@@ -48,87 +48,66 @@ const carouselItemsComplete = exports.carouselItemsComplete = {
|
|
|
48
48
|
desktopHeight: 475,
|
|
49
49
|
headerCopy: 'Over the past two years, we’ve supported',
|
|
50
50
|
peopleHelpedText: '11.7 million people',
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
autoPlay: false,
|
|
52
|
+
node1Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
53
|
+
node1Amount: '1,000',
|
|
54
|
+
node1Image: {
|
|
55
55
|
file: {
|
|
56
56
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
node2Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
60
|
+
node2Amount: '750,000',
|
|
61
|
+
node2Image: {
|
|
62
62
|
file: {
|
|
63
63
|
url: 'https://images.ctfassets.net/zsfivwzfgl3t/5uKnps3prnG6GpTM1EPZdC/8d7264465846de31e3bbb5b6b2c36c8f/014-helping_hand.png'
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
file: {
|
|
70
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
node4_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
74
|
-
node4_Amount: '4,000',
|
|
75
|
-
node4_Image: {
|
|
76
|
-
file: {
|
|
77
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
node5_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
81
|
-
node5_Amount: '5,000',
|
|
82
|
-
node5_Image: {
|
|
83
|
-
file: {
|
|
84
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
node6_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
88
|
-
node6_Amount: '6,000',
|
|
89
|
-
node6_Image: {
|
|
66
|
+
node3Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
67
|
+
node3Amount: '3,000',
|
|
68
|
+
node3Image: {
|
|
90
69
|
file: {
|
|
91
70
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
92
71
|
}
|
|
93
72
|
},
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
73
|
+
node4Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
74
|
+
node4Amount: '4,000',
|
|
75
|
+
node4Image: {
|
|
97
76
|
file: {
|
|
98
77
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
99
78
|
}
|
|
100
79
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
80
|
+
node5Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
81
|
+
node5Amount: '5,000',
|
|
82
|
+
node5Image: {
|
|
104
83
|
file: {
|
|
105
84
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
106
85
|
}
|
|
107
86
|
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
87
|
+
node6Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
88
|
+
node6Amount: '6,000',
|
|
89
|
+
node6Image: {
|
|
111
90
|
file: {
|
|
112
91
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
113
92
|
}
|
|
114
93
|
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
94
|
+
node7Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
95
|
+
node7Amount: '7,000',
|
|
96
|
+
node7Image: {
|
|
118
97
|
file: {
|
|
119
98
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
120
99
|
}
|
|
121
100
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
101
|
+
node8Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
102
|
+
node8Amount: '8,000',
|
|
103
|
+
node8Image: {
|
|
125
104
|
file: {
|
|
126
105
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
127
106
|
}
|
|
128
107
|
},
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
108
|
+
node9Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
109
|
+
node9Amount: '9,000',
|
|
110
|
+
node9Image: {
|
|
132
111
|
file: {
|
|
133
112
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
134
113
|
}
|
|
@@ -143,77 +122,56 @@ const carouselItemsIncomplete = exports.carouselItemsIncomplete = {
|
|
|
143
122
|
headerCopy: 'Over the past two years, we’ve supported',
|
|
144
123
|
peopleHelpedText: '11.7 million people',
|
|
145
124
|
autoPlay: false,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
125
|
+
node1Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
126
|
+
node1Amount: '1,000',
|
|
127
|
+
node1Image: {
|
|
149
128
|
file: {
|
|
150
129
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
151
130
|
}
|
|
152
131
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
132
|
+
node2Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
133
|
+
node2Amount: '750,000',
|
|
134
|
+
node2Image: {
|
|
156
135
|
file: {
|
|
157
136
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
158
137
|
}
|
|
159
138
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
139
|
+
node3Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
140
|
+
node3Amount: '3,000',
|
|
141
|
+
node3Image: {
|
|
163
142
|
file: {
|
|
164
143
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
165
144
|
}
|
|
166
145
|
},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
146
|
+
node4Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
147
|
+
node4Amount: '4,000',
|
|
148
|
+
node4Image: {
|
|
170
149
|
file: {
|
|
171
150
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
172
151
|
}
|
|
173
152
|
},
|
|
174
|
-
|
|
175
|
-
|
|
153
|
+
node5Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
154
|
+
node5Image: {
|
|
176
155
|
file: {
|
|
177
156
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
178
157
|
}
|
|
179
158
|
},
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
159
|
+
node6Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
160
|
+
node6Amount: '6,000',
|
|
161
|
+
node6Image: null,
|
|
162
|
+
node7Copy: null,
|
|
163
|
+
node7Amount: null,
|
|
164
|
+
node7Image: null,
|
|
165
|
+
node8Copy: null,
|
|
166
|
+
node8Amount: null,
|
|
167
|
+
node8Image: {
|
|
189
168
|
file: {
|
|
190
169
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
191
170
|
}
|
|
192
171
|
},
|
|
193
172
|
node9_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
194
173
|
node9_Amount: null,
|
|
195
|
-
node9_Image: null
|
|
196
|
-
node10_Copy: null,
|
|
197
|
-
node10_Amount: '10,000',
|
|
198
|
-
node10_Image: {
|
|
199
|
-
file: {
|
|
200
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
node11_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
204
|
-
node11_Amount: '11,000',
|
|
205
|
-
node11_Image: {
|
|
206
|
-
file: {
|
|
207
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
208
|
-
}
|
|
209
|
-
},
|
|
210
|
-
node12_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.750,000',
|
|
211
|
-
node12_Amount: null,
|
|
212
|
-
node12_Image: {
|
|
213
|
-
file: {
|
|
214
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
215
|
-
}
|
|
216
|
-
}
|
|
174
|
+
node9_Image: null
|
|
217
175
|
};
|
|
218
176
|
const carouselItemsMinimal = exports.carouselItemsMinimal = {
|
|
219
177
|
__typename: 'ContentfulWhatYourMoneyDoesCarousel',
|
|
@@ -224,30 +182,30 @@ const carouselItemsMinimal = exports.carouselItemsMinimal = {
|
|
|
224
182
|
headerCopy: 'Over the past two years, we’ve supported',
|
|
225
183
|
peopleHelpedText: '11.7 million people',
|
|
226
184
|
autoPlay: false,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
185
|
+
node1Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
186
|
+
node1Amount: '1,000',
|
|
187
|
+
node1Image: {
|
|
230
188
|
file: {
|
|
231
189
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
232
190
|
}
|
|
233
191
|
},
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
192
|
+
node2Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
193
|
+
node2Amount: '750,000',
|
|
194
|
+
node2Image: {
|
|
237
195
|
file: {
|
|
238
196
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
239
197
|
}
|
|
240
198
|
},
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
199
|
+
node3Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
200
|
+
node3Amount: '3,000',
|
|
201
|
+
node3Image: {
|
|
244
202
|
file: {
|
|
245
203
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
246
204
|
}
|
|
247
205
|
},
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
206
|
+
node4Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
207
|
+
node4Amount: '4,000',
|
|
208
|
+
node4Image: {
|
|
251
209
|
file: {
|
|
252
210
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
253
211
|
}
|
package/package.json
CHANGED
|
@@ -145,87 +145,66 @@ const WYMDCarousel = ({ data, data: { autoPlay, contentful_id: thisID } }) => {
|
|
|
145
145
|
WYMDCarousel.propTypes = {
|
|
146
146
|
data: PropTypes.shape({
|
|
147
147
|
// Required 'node' fields:
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
node1Amount: PropTypes.string.isRequired,
|
|
149
|
+
node1Copy: PropTypes.string.isRequired,
|
|
150
|
+
node1Image: PropTypes.shape({
|
|
151
151
|
file: PropTypes.shape({
|
|
152
152
|
url: PropTypes.string.isRequired
|
|
153
153
|
}).isRequired
|
|
154
154
|
}).isRequired,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
node2Amount: PropTypes.string.isRequired,
|
|
156
|
+
node2Copy: PropTypes.string.isRequired,
|
|
157
|
+
node2Image: PropTypes.shape({
|
|
158
158
|
file: PropTypes.shape({
|
|
159
159
|
url: PropTypes.string.isRequired
|
|
160
160
|
}).isRequired
|
|
161
161
|
}).isRequired,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
node3Amount: PropTypes.string.isRequired,
|
|
163
|
+
node3Copy: PropTypes.string.isRequired,
|
|
164
|
+
node3Image: PropTypes.shape({
|
|
165
165
|
file: PropTypes.shape({
|
|
166
166
|
url: PropTypes.string.isRequired
|
|
167
167
|
}).isRequired
|
|
168
168
|
}).isRequired,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
node4Amount: PropTypes.string.isRequired,
|
|
170
|
+
node4Copy: PropTypes.string.isRequired,
|
|
171
|
+
node4Image: PropTypes.shape({
|
|
172
172
|
file: PropTypes.shape({
|
|
173
173
|
url: PropTypes.string.isRequired
|
|
174
174
|
}).isRequired
|
|
175
175
|
}).isRequired,
|
|
176
176
|
// Non-required 'node' fields:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
node5Amount: PropTypes.string,
|
|
178
|
+
node5Copy: PropTypes.string,
|
|
179
|
+
node5Image: PropTypes.shape({
|
|
180
180
|
file: PropTypes.shape({
|
|
181
181
|
url: PropTypes.string
|
|
182
182
|
})
|
|
183
183
|
}),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
node6Amount: PropTypes.string,
|
|
185
|
+
node6Copy: PropTypes.string,
|
|
186
|
+
node6Image: PropTypes.shape({
|
|
187
187
|
file: PropTypes.shape({
|
|
188
188
|
url: PropTypes.string
|
|
189
189
|
})
|
|
190
190
|
}),
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
node7Amount: PropTypes.string,
|
|
192
|
+
node7Copy: PropTypes.string,
|
|
193
|
+
node7Image: PropTypes.shape({
|
|
194
194
|
file: PropTypes.shape({
|
|
195
195
|
url: PropTypes.string
|
|
196
196
|
})
|
|
197
197
|
}),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
node8Amount: PropTypes.string,
|
|
199
|
+
node8Copy: PropTypes.string,
|
|
200
|
+
node8Image: PropTypes.shape({
|
|
201
201
|
file: PropTypes.shape({
|
|
202
202
|
url: PropTypes.string
|
|
203
203
|
})
|
|
204
204
|
}),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
file: PropTypes.shape({
|
|
209
|
-
url: PropTypes.string
|
|
210
|
-
})
|
|
211
|
-
}),
|
|
212
|
-
node10_Amount: PropTypes.string,
|
|
213
|
-
node10_Copy: PropTypes.string,
|
|
214
|
-
node10_Image: PropTypes.shape({
|
|
215
|
-
file: PropTypes.shape({
|
|
216
|
-
url: PropTypes.string
|
|
217
|
-
})
|
|
218
|
-
}),
|
|
219
|
-
node11_Amount: PropTypes.string,
|
|
220
|
-
node11_Copy: PropTypes.string,
|
|
221
|
-
node11_Image: PropTypes.shape({
|
|
222
|
-
file: PropTypes.shape({
|
|
223
|
-
url: PropTypes.string
|
|
224
|
-
})
|
|
225
|
-
}),
|
|
226
|
-
node12_Amount: PropTypes.string,
|
|
227
|
-
node12_Copy: PropTypes.string,
|
|
228
|
-
node12_Image: PropTypes.shape({
|
|
205
|
+
node9Amount: PropTypes.string,
|
|
206
|
+
node9Copy: PropTypes.string,
|
|
207
|
+
node9Image: PropTypes.shape({
|
|
229
208
|
file: PropTypes.shape({
|
|
230
209
|
url: PropTypes.string
|
|
231
210
|
})
|
|
@@ -3,7 +3,7 @@ const formatItems = thisData => {
|
|
|
3
3
|
const allValidNodes = [];
|
|
4
4
|
|
|
5
5
|
// Set at a Content Type field level, so doesn't need to be dynamic:
|
|
6
|
-
const possibleNumberOfNodes =
|
|
6
|
+
const possibleNumberOfNodes = 9;
|
|
7
7
|
|
|
8
8
|
// Grab ALL keys from our raw data:
|
|
9
9
|
const theseKeys = Object.keys(thisData);
|
|
@@ -13,7 +13,7 @@ const formatItems = thisData => {
|
|
|
13
13
|
for (let i = 1; i <= possibleNumberOfNodes; i += 1) {
|
|
14
14
|
// Create a dynamic key prefix based on the counter, obviously matching
|
|
15
15
|
// the naming convention set at the Content Type level in the CMS
|
|
16
|
-
const thisKeyPrefix = `node${i}
|
|
16
|
+
const thisKeyPrefix = `node${i}`;
|
|
17
17
|
|
|
18
18
|
// Make an array of objects, each object representing a specific node and its fields:
|
|
19
19
|
const thisNodeContent = theseKeys
|
|
@@ -23,7 +23,7 @@ const formatItems = thisData => {
|
|
|
23
23
|
// Only assign if we have actually have a value; only the fields for nodes 1-4 are required:
|
|
24
24
|
if (thisData[thisKey]) {
|
|
25
25
|
// Use a repeatable, generic key so rendering is a LOT easier:
|
|
26
|
-
const simplifedKey = thisKey.split(
|
|
26
|
+
const simplifedKey = thisKey.split(/([0-9])/).pop().toLowerCase();
|
|
27
27
|
thisFilteredObj[simplifedKey] = thisData[thisKey];
|
|
28
28
|
}
|
|
29
29
|
return thisFilteredObj;
|
|
@@ -57,87 +57,66 @@ const carouselItemsComplete = {
|
|
|
57
57
|
desktopHeight: 475,
|
|
58
58
|
headerCopy: 'Over the past two years, we’ve supported',
|
|
59
59
|
peopleHelpedText: '11.7 million people',
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
autoPlay: false,
|
|
61
|
+
node1Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
62
|
+
node1Amount: '1,000',
|
|
63
|
+
node1Image: {
|
|
64
64
|
file: {
|
|
65
65
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
node2Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
69
|
+
node2Amount: '750,000',
|
|
70
|
+
node2Image: {
|
|
71
71
|
file: {
|
|
72
72
|
url: 'https://images.ctfassets.net/zsfivwzfgl3t/5uKnps3prnG6GpTM1EPZdC/8d7264465846de31e3bbb5b6b2c36c8f/014-helping_hand.png'
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
file: {
|
|
79
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
node4_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
83
|
-
node4_Amount: '4,000',
|
|
84
|
-
node4_Image: {
|
|
85
|
-
file: {
|
|
86
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
node5_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
90
|
-
node5_Amount: '5,000',
|
|
91
|
-
node5_Image: {
|
|
92
|
-
file: {
|
|
93
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
node6_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
97
|
-
node6_Amount: '6,000',
|
|
98
|
-
node6_Image: {
|
|
75
|
+
node3Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
76
|
+
node3Amount: '3,000',
|
|
77
|
+
node3Image: {
|
|
99
78
|
file: {
|
|
100
79
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
101
80
|
}
|
|
102
81
|
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
82
|
+
node4Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
83
|
+
node4Amount: '4,000',
|
|
84
|
+
node4Image: {
|
|
106
85
|
file: {
|
|
107
86
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
108
87
|
}
|
|
109
88
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
89
|
+
node5Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
90
|
+
node5Amount: '5,000',
|
|
91
|
+
node5Image: {
|
|
113
92
|
file: {
|
|
114
93
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
115
94
|
}
|
|
116
95
|
},
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
96
|
+
node6Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
97
|
+
node6Amount: '6,000',
|
|
98
|
+
node6Image: {
|
|
120
99
|
file: {
|
|
121
100
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
122
101
|
}
|
|
123
102
|
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
103
|
+
node7Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
104
|
+
node7Amount: '7,000',
|
|
105
|
+
node7Image: {
|
|
127
106
|
file: {
|
|
128
107
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
129
108
|
}
|
|
130
109
|
},
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
110
|
+
node8Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
111
|
+
node8Amount: '8,000',
|
|
112
|
+
node8Image: {
|
|
134
113
|
file: {
|
|
135
114
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
136
115
|
}
|
|
137
116
|
},
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
117
|
+
node9Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
118
|
+
node9Amount: '9,000',
|
|
119
|
+
node9Image: {
|
|
141
120
|
file: {
|
|
142
121
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
143
122
|
}
|
|
@@ -153,77 +132,56 @@ const carouselItemsIncomplete = {
|
|
|
153
132
|
headerCopy: 'Over the past two years, we’ve supported',
|
|
154
133
|
peopleHelpedText: '11.7 million people',
|
|
155
134
|
autoPlay: false,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
135
|
+
node1Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
136
|
+
node1Amount: '1,000',
|
|
137
|
+
node1Image: {
|
|
159
138
|
file: {
|
|
160
139
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
161
140
|
}
|
|
162
141
|
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
142
|
+
node2Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
143
|
+
node2Amount: '750,000',
|
|
144
|
+
node2Image: {
|
|
166
145
|
file: {
|
|
167
146
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
168
147
|
}
|
|
169
148
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
149
|
+
node3Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
150
|
+
node3Amount: '3,000',
|
|
151
|
+
node3Image: {
|
|
173
152
|
file: {
|
|
174
153
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
175
154
|
}
|
|
176
155
|
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
156
|
+
node4Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
157
|
+
node4Amount: '4,000',
|
|
158
|
+
node4Image: {
|
|
180
159
|
file: {
|
|
181
160
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
182
161
|
}
|
|
183
162
|
},
|
|
184
|
-
|
|
185
|
-
|
|
163
|
+
node5Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
164
|
+
node5Image: {
|
|
186
165
|
file: {
|
|
187
166
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
188
167
|
}
|
|
189
168
|
},
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
169
|
+
node6Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
170
|
+
node6Amount: '6,000',
|
|
171
|
+
node6Image: null,
|
|
172
|
+
node7Copy: null,
|
|
173
|
+
node7Amount: null,
|
|
174
|
+
node7Image: null,
|
|
175
|
+
node8Copy: null,
|
|
176
|
+
node8Amount: null,
|
|
177
|
+
node8Image: {
|
|
199
178
|
file: {
|
|
200
179
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
201
180
|
}
|
|
202
181
|
},
|
|
203
182
|
node9_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
204
183
|
node9_Amount: null,
|
|
205
|
-
node9_Image: null
|
|
206
|
-
node10_Copy: null,
|
|
207
|
-
node10_Amount: '10,000',
|
|
208
|
-
node10_Image: {
|
|
209
|
-
file: {
|
|
210
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
node11_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
214
|
-
node11_Amount: '11,000',
|
|
215
|
-
node11_Image: {
|
|
216
|
-
file: {
|
|
217
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
218
|
-
}
|
|
219
|
-
},
|
|
220
|
-
node12_Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.750,000',
|
|
221
|
-
node12_Amount: null,
|
|
222
|
-
node12_Image: {
|
|
223
|
-
file: {
|
|
224
|
-
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
225
|
-
}
|
|
226
|
-
}
|
|
184
|
+
node9_Image: null
|
|
227
185
|
};
|
|
228
186
|
|
|
229
187
|
const carouselItemsMinimal = {
|
|
@@ -235,30 +193,30 @@ const carouselItemsMinimal = {
|
|
|
235
193
|
headerCopy: 'Over the past two years, we’ve supported',
|
|
236
194
|
peopleHelpedText: '11.7 million people',
|
|
237
195
|
autoPlay: false,
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
196
|
+
node1Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
197
|
+
node1Amount: '1,000',
|
|
198
|
+
node1Image: {
|
|
241
199
|
file: {
|
|
242
200
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
243
201
|
}
|
|
244
202
|
},
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
203
|
+
node2Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
204
|
+
node2Amount: '750,000',
|
|
205
|
+
node2Image: {
|
|
248
206
|
file: {
|
|
249
207
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
250
208
|
}
|
|
251
209
|
},
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
210
|
+
node3Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
211
|
+
node3Amount: '3,000',
|
|
212
|
+
node3Image: {
|
|
255
213
|
file: {
|
|
256
214
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
257
215
|
}
|
|
258
216
|
},
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
217
|
+
node4Copy: 'children and young people in the UK and around the world, including with safe homes, good nutrition and access to quality healthcare and education.',
|
|
218
|
+
node4Amount: '4,000',
|
|
219
|
+
node4Image: {
|
|
262
220
|
file: {
|
|
263
221
|
url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
|
|
264
222
|
}
|