@comicrelief/component-library 7.35.6 → 7.35.7

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.
@@ -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,87 @@ 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: {
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: {
69
69
  file: {
70
70
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
71
71
  }
72
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: {
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: {
76
76
  file: {
77
77
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
78
78
  }
79
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: {
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: {
83
83
  file: {
84
84
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
85
85
  }
86
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: {
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: {
90
90
  file: {
91
91
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
92
92
  }
93
93
  },
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: {
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: {
97
97
  file: {
98
98
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
99
99
  }
100
100
  },
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: {
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: {
104
104
  file: {
105
105
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
106
106
  }
107
107
  },
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: {
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: {
111
111
  file: {
112
112
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
113
113
  }
114
114
  },
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: {
115
+ node10Copy: '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
+ node10Amount: '10,000',
117
+ node10Image: {
118
118
  file: {
119
119
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
120
120
  }
121
121
  },
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: {
122
+ node11Copy: '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
+ node11Amount: '11,000',
124
+ node11Image: {
125
125
  file: {
126
126
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
127
127
  }
128
128
  },
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: {
129
+ node12Copy: '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
+ node12Amount: '12,000',
131
+ node12Image: {
132
132
  file: {
133
133
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
134
134
  }
@@ -143,73 +143,73 @@ const carouselItemsIncomplete = exports.carouselItemsIncomplete = {
143
143
  headerCopy: 'Over the past two years, we’ve supported',
144
144
  peopleHelpedText: '11.7 million people',
145
145
  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: {
146
+ 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.',
147
+ node1Amount: '1,000',
148
+ node1Image: {
149
149
  file: {
150
150
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
151
151
  }
152
152
  },
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: {
153
+ 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.',
154
+ node2Amount: '750,000',
155
+ node2Image: {
156
156
  file: {
157
157
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
158
158
  }
159
159
  },
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: {
160
+ 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.',
161
+ node3Amount: '3,000',
162
+ node3Image: {
163
163
  file: {
164
164
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
165
165
  }
166
166
  },
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: {
167
+ 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.',
168
+ node4Amount: '4,000',
169
+ node4Image: {
170
170
  file: {
171
171
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
172
172
  }
173
173
  },
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: {
174
+ 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.',
175
+ node5Image: {
176
176
  file: {
177
177
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
178
178
  }
179
179
  },
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: {
180
+ 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.',
181
+ node6Amount: '6,000',
182
+ node6Image: null,
183
+ node7Copy: null,
184
+ node7Amount: null,
185
+ node7Image: null,
186
+ node8Copy: null,
187
+ node8Amount: null,
188
+ node8Image: {
189
189
  file: {
190
190
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
191
191
  }
192
192
  },
193
- 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
- node9_Amount: null,
195
- node9_Image: null,
196
- node10_Copy: null,
197
- node10_Amount: '10,000',
198
- node10_Image: {
193
+ 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.',
194
+ node9Amount: null,
195
+ node9Image: null,
196
+ node10Copy: null,
197
+ node10Amount: '10,000',
198
+ node10Image: {
199
199
  file: {
200
200
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
201
201
  }
202
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: {
203
+ node11Copy: '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
+ node11Amount: '11,000',
205
+ node11Image: {
206
206
  file: {
207
207
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
208
208
  }
209
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: {
210
+ node12Copy: '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
+ node12Amount: null,
212
+ node12Image: {
213
213
  file: {
214
214
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
215
215
  }
@@ -224,30 +224,30 @@ const carouselItemsMinimal = exports.carouselItemsMinimal = {
224
224
  headerCopy: 'Over the past two years, we’ve supported',
225
225
  peopleHelpedText: '11.7 million people',
226
226
  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: {
227
+ 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.',
228
+ node1Amount: '1,000',
229
+ node1Image: {
230
230
  file: {
231
231
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
232
232
  }
233
233
  },
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: {
234
+ 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.',
235
+ node2Amount: '750,000',
236
+ node2Image: {
237
237
  file: {
238
238
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
239
239
  }
240
240
  },
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: {
241
+ 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.',
242
+ node3Amount: '3,000',
243
+ node3Image: {
244
244
  file: {
245
245
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
246
246
  }
247
247
  },
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: {
248
+ 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.',
249
+ node4Amount: '4,000',
250
+ node4Image: {
251
251
  file: {
252
252
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
253
253
  }
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.7",
5
5
  "main": "dist/index.js",
6
6
  "license": "ISC",
7
7
  "jest": {
@@ -145,87 +145,87 @@ 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({
205
+ node9Amount: PropTypes.string,
206
+ node9Copy: PropTypes.string,
207
+ node9Image: PropTypes.shape({
208
208
  file: PropTypes.shape({
209
209
  url: PropTypes.string
210
210
  })
211
211
  }),
212
- node10_Amount: PropTypes.string,
213
- node10_Copy: PropTypes.string,
214
- node10_Image: PropTypes.shape({
212
+ node10Amount: PropTypes.string,
213
+ node10Copy: PropTypes.string,
214
+ node10Image: PropTypes.shape({
215
215
  file: PropTypes.shape({
216
216
  url: PropTypes.string
217
217
  })
218
218
  }),
219
- node11_Amount: PropTypes.string,
220
- node11_Copy: PropTypes.string,
221
- node11_Image: PropTypes.shape({
219
+ node11Amount: PropTypes.string,
220
+ node11Copy: PropTypes.string,
221
+ node11Image: PropTypes.shape({
222
222
  file: PropTypes.shape({
223
223
  url: PropTypes.string
224
224
  })
225
225
  }),
226
- node12_Amount: PropTypes.string,
227
- node12_Copy: PropTypes.string,
228
- node12_Image: PropTypes.shape({
226
+ node12Amount: PropTypes.string,
227
+ node12Copy: PropTypes.string,
228
+ node12Image: PropTypes.shape({
229
229
  file: PropTypes.shape({
230
230
  url: PropTypes.string
231
231
  })
@@ -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,87 @@ 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: {
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: {
78
78
  file: {
79
79
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
80
80
  }
81
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: {
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: {
85
85
  file: {
86
86
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
87
87
  }
88
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: {
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: {
92
92
  file: {
93
93
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
94
94
  }
95
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: {
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: {
99
99
  file: {
100
100
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
101
101
  }
102
102
  },
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: {
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: {
106
106
  file: {
107
107
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
108
108
  }
109
109
  },
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: {
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: {
113
113
  file: {
114
114
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
115
115
  }
116
116
  },
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: {
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: {
120
120
  file: {
121
121
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
122
122
  }
123
123
  },
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: {
124
+ node10Copy: '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
+ node10Amount: '10,000',
126
+ node10Image: {
127
127
  file: {
128
128
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
129
129
  }
130
130
  },
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: {
131
+ node11Copy: '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
+ node11Amount: '11,000',
133
+ node11Image: {
134
134
  file: {
135
135
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
136
136
  }
137
137
  },
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: {
138
+ node12Copy: '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
+ node12Amount: '12,000',
140
+ node12Image: {
141
141
  file: {
142
142
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
143
143
  }
@@ -153,73 +153,73 @@ const carouselItemsIncomplete = {
153
153
  headerCopy: 'Over the past two years, we’ve supported',
154
154
  peopleHelpedText: '11.7 million people',
155
155
  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: {
156
+ 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.',
157
+ node1Amount: '1,000',
158
+ node1Image: {
159
159
  file: {
160
160
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
161
161
  }
162
162
  },
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: {
163
+ 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.',
164
+ node2Amount: '750,000',
165
+ node2Image: {
166
166
  file: {
167
167
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
168
168
  }
169
169
  },
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: {
170
+ 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.',
171
+ node3Amount: '3,000',
172
+ node3Image: {
173
173
  file: {
174
174
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
175
175
  }
176
176
  },
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: {
177
+ 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.',
178
+ node4Amount: '4,000',
179
+ node4Image: {
180
180
  file: {
181
181
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
182
182
  }
183
183
  },
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: {
184
+ 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.',
185
+ node5Image: {
186
186
  file: {
187
187
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
188
188
  }
189
189
  },
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: {
190
+ 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.',
191
+ node6Amount: '6,000',
192
+ node6Image: null,
193
+ node7Copy: null,
194
+ node7Amount: null,
195
+ node7Image: null,
196
+ node8Copy: null,
197
+ node8Amount: null,
198
+ node8Image: {
199
199
  file: {
200
200
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
201
201
  }
202
202
  },
203
- 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
- node9_Amount: null,
205
- node9_Image: null,
206
- node10_Copy: null,
207
- node10_Amount: '10,000',
208
- node10_Image: {
203
+ 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.',
204
+ node9Amount: null,
205
+ node9Image: null,
206
+ node10Copy: null,
207
+ node10Amount: '10,000',
208
+ node10Image: {
209
209
  file: {
210
210
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
211
211
  }
212
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: {
213
+ node11Copy: '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
+ node11Amount: '11,000',
215
+ node11Image: {
216
216
  file: {
217
217
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
218
218
  }
219
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: {
220
+ node12Copy: '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
+ node12Amount: null,
222
+ node12Image: {
223
223
  file: {
224
224
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
225
225
  }
@@ -235,30 +235,30 @@ const carouselItemsMinimal = {
235
235
  headerCopy: 'Over the past two years, we’ve supported',
236
236
  peopleHelpedText: '11.7 million people',
237
237
  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: {
238
+ 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.',
239
+ node1Amount: '1,000',
240
+ node1Image: {
241
241
  file: {
242
242
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
243
243
  }
244
244
  },
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: {
245
+ 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.',
246
+ node2Amount: '750,000',
247
+ node2Image: {
248
248
  file: {
249
249
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
250
250
  }
251
251
  },
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: {
252
+ 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.',
253
+ node3Amount: '3,000',
254
+ node3Image: {
255
255
  file: {
256
256
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
257
257
  }
258
258
  },
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: {
259
+ 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.',
260
+ node4Amount: '4,000',
261
+ node4Image: {
262
262
  file: {
263
263
  url: '//images.ctfassets.net/zsfivwzfgl3t/45yv3H0XZsvsySHtutQ8vb/1fb6d1afe4037c7dccde743a747f6b4f/Test-Carousel-Icon.png'
264
264
  }