@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.
@@ -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;
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('_').pop().toLowerCase();
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
- autoplay: false,
52
- node1_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.',
53
- node1_Amount: '1,000',
54
- node1_Image: {
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
- node2_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.',
60
- node2_Amount: '750,000',
61
- node2_Image: {
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
- node3_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.',
67
- node3_Amount: '3,000',
68
- node3_Image: {
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
- node7_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.',
95
- node7_Amount: '7,000',
96
- node7_Image: {
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
- node8_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.',
102
- node8_Amount: '8,000',
103
- node8_Image: {
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
- 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.',
109
- node9_Amount: '9,000',
110
- node9_Image: {
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
- node10_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.',
116
- node10_Amount: '10,000',
117
- node10_Image: {
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
- 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.',
123
- node11_Amount: '11,000',
124
- node11_Image: {
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
- 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',
130
- node12_Amount: '12,000',
131
- node12_Image: {
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
- node1_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.',
147
- node1_Amount: '1,000',
148
- node1_Image: {
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
- node2_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.',
154
- node2_Amount: '750,000',
155
- node2_Image: {
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
- node3_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.',
161
- node3_Amount: '3,000',
162
- node3_Image: {
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
- 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.',
168
- node4_Amount: '4,000',
169
- node4_Image: {
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
- 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.',
175
- node5_Image: {
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
- 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.',
181
- node6_Amount: '6,000',
182
- node6_Image: null,
183
- node7_Copy: null,
184
- node7_Amount: null,
185
- node7_Image: null,
186
- node8_Copy: null,
187
- node8_Amount: null,
188
- node8_Image: {
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
- node1_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.',
228
- node1_Amount: '1,000',
229
- node1_Image: {
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
- node2_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.',
235
- node2_Amount: '750,000',
236
- node2_Image: {
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
- node3_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.',
242
- node3_Amount: '3,000',
243
- node3_Image: {
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
- 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.',
249
- node4_Amount: '4,000',
250
- node4_Image: {
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@comicrelief/component-library",
3
3
  "author": "Comic Relief Engineering Team",
4
- "version": "7.35.6",
4
+ "version": "7.35.8",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -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
- node1_Amount: PropTypes.string.isRequired,
149
- node1_Copy: PropTypes.string.isRequired,
150
- node1_Image: PropTypes.shape({
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
- node2_Amount: PropTypes.string.isRequired,
156
- node2_Copy: PropTypes.string.isRequired,
157
- node2_Image: PropTypes.shape({
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
- node3_Amount: PropTypes.string.isRequired,
163
- node3_Copy: PropTypes.string.isRequired,
164
- node3_Image: PropTypes.shape({
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
- node4_Amount: PropTypes.string.isRequired,
170
- node4_Copy: PropTypes.string.isRequired,
171
- node4_Image: PropTypes.shape({
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
- node5_Amount: PropTypes.string,
178
- node5_Copy: PropTypes.string,
179
- node5_Image: PropTypes.shape({
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
- node6_Amount: PropTypes.string,
185
- node6_Copy: PropTypes.string,
186
- node6_Image: PropTypes.shape({
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
- node7_Amount: PropTypes.string,
192
- node7_Copy: PropTypes.string,
193
- node7_Image: PropTypes.shape({
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
- node8_Amount: PropTypes.string,
199
- node8_Copy: PropTypes.string,
200
- node8_Image: PropTypes.shape({
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
- node9_Amount: PropTypes.string,
206
- node9_Copy: PropTypes.string,
207
- node9_Image: PropTypes.shape({
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 = 12;
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('_').pop().toLowerCase();
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
- autoplay: false,
61
- node1_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.',
62
- node1_Amount: '1,000',
63
- node1_Image: {
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
- node2_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.',
69
- node2_Amount: '750,000',
70
- node2_Image: {
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
- node3_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.',
76
- node3_Amount: '3,000',
77
- node3_Image: {
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
- node7_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.',
104
- node7_Amount: '7,000',
105
- node7_Image: {
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
- node8_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.',
111
- node8_Amount: '8,000',
112
- node8_Image: {
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
- 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.',
118
- node9_Amount: '9,000',
119
- node9_Image: {
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
- node10_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.',
125
- node10_Amount: '10,000',
126
- node10_Image: {
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
- 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.',
132
- node11_Amount: '11,000',
133
- node11_Image: {
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
- 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',
139
- node12_Amount: '12,000',
140
- node12_Image: {
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
- node1_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.',
157
- node1_Amount: '1,000',
158
- node1_Image: {
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
- node2_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.',
164
- node2_Amount: '750,000',
165
- node2_Image: {
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
- node3_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.',
171
- node3_Amount: '3,000',
172
- node3_Image: {
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
- 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.',
178
- node4_Amount: '4,000',
179
- node4_Image: {
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
- 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.',
185
- node5_Image: {
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
- 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.',
191
- node6_Amount: '6,000',
192
- node6_Image: null,
193
- node7_Copy: null,
194
- node7_Amount: null,
195
- node7_Image: null,
196
- node8_Copy: null,
197
- node8_Amount: null,
198
- node8_Image: {
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
- node1_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.',
239
- node1_Amount: '1,000',
240
- node1_Image: {
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
- node2_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.',
246
- node2_Amount: '750,000',
247
- node2_Image: {
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
- node3_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.',
253
- node3_Amount: '3,000',
254
- node3_Image: {
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
- 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.',
260
- node4_Amount: '4,000',
261
- node4_Image: {
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
  }