@@ -4,10 +4,6 @@ import type { Decorator, Meta, StoryObj } from '@storybook/react';
4
4
import { useState } from 'react' ;
5
5
import { ArticleDesign , ArticleDisplay , Pillar } from '../../lib/articleFormat' ;
6
6
import type { AdTargeting } from '../../types/commercial' ;
7
- import type {
8
- ImagePositionType ,
9
- ImageSizeType ,
10
- } from '../Card/components/ImageWrapper' ;
11
7
import type { Props } from './YoutubeAtom' ;
12
8
import { YoutubeAtom } from './YoutubeAtom' ;
13
9
@@ -129,9 +125,6 @@ const adTargetingAndConsentGiven = {
129
125
...consentGiven ,
130
126
} satisfies AdTargeting & ConsentState ;
131
127
132
- const imagePositionOnMobile : ImagePositionType = 'none' ;
133
- const imageSize : ImageSizeType = 'large' ;
134
-
135
128
const baseConfiguration = {
136
129
atomId : 'a2502abd-1373-45a2-b508-3e5a2ec050be' ,
137
130
videoId : '-ZCvZmYlQD8' ,
@@ -153,8 +146,10 @@ const baseConfiguration = {
153
146
isMainMedia : false ,
154
147
abTestParticipations : { } ,
155
148
adTargeting : disableAds ,
156
- imagePositionOnMobile,
157
- imageSize,
149
+ iconSizeOnDesktop : 'large' ,
150
+ iconSizeOnMobile : 'large' ,
151
+ hidePillOnMobile : false ,
152
+ showTextOverlay : false ,
158
153
consentState : consentGiven ,
159
154
renderingTarget : 'Web' ,
160
155
} satisfies Partial < Props > ;
@@ -178,26 +173,7 @@ export const NoOverlay = {
178
173
} ,
179
174
} satisfies Story ;
180
175
181
- export const WithOverrideImage = {
182
- args : {
183
- ...baseConfiguration ,
184
- videoId : '3jpXAMwRSu4' ,
185
- alt : 'Microscopic image of COVID' ,
186
- format : {
187
- theme : Pillar . News ,
188
- design : ArticleDesign . Standard ,
189
- display : ArticleDisplay . Standard ,
190
- } ,
191
- overrideImage :
192
- 'https://i.guim.co.uk/img/media/4b3808707ec341629932a9d443ff5a812cf4df14/0_309_1800_1081/master/1800.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=aff4b8255693eb449f13070df88e9cac' ,
193
- height : undefined ,
194
- width : undefined ,
195
- title : 'How to stop the spread of coronavirus' ,
196
- } ,
197
- decorators : [ OverlayAutoplayExplainer , Container ] ,
198
- } satisfies Story ;
199
-
200
- export const WithPosterImage = {
176
+ export const WithImage = {
201
177
args : {
202
178
...baseConfiguration ,
203
179
videoId : 'N9Cgy-ke5-s' ,
@@ -206,41 +182,21 @@ export const WithPosterImage = {
206
182
design : ArticleDesign . Standard ,
207
183
display : ArticleDisplay . Standard ,
208
184
} ,
209
- posterImage :
210
- 'https://media.guim.co.uk/757dd4db5818984fd600b41cdaf687668497051d/0_0_1920_1080/1920.jpg' ,
185
+ image : 'https://media.guim.co.uk/757dd4db5818984fd600b41cdaf687668497051d/0_0_1920_1080/1920.jpg' ,
211
186
title : 'How Donald Trump’s broken promises failed Ohio | Anywhere but Washington' ,
212
187
} ,
213
188
decorators : [ OverlayAutoplayExplainer , Container ] ,
214
189
} satisfies Story ;
215
190
216
- export const WithOverlayAndPosterImage = {
217
- args : {
218
- ...baseConfiguration ,
219
- videoId : WithPosterImage . args . videoId ,
220
- format : {
221
- theme : Pillar . Opinion ,
222
- design : ArticleDesign . Standard ,
223
- display : ArticleDisplay . Standard ,
224
- } ,
225
- posterImage : WithPosterImage . args . posterImage ,
226
- overrideImage :
227
- 'https://i.guim.co.uk/img/media/4b3808707ec341629932a9d443ff5a812cf4df14/0_309_1800_1081/master/1800.jpg' ,
228
- title : 'How Donald Trump’s broken promises failed Ohio' ,
229
- kicker : 'Breaking News' ,
230
- showTextOverlay : true ,
231
- } ,
232
- decorators : [ OverlayAutoplayExplainer , Container ] ,
233
- } satisfies Story ;
234
-
235
191
export const GiveConsent = {
236
192
args : {
237
193
...baseConfiguration ,
238
194
...consentNotGiven ,
239
- videoId : WithOverrideImage . args . videoId ,
240
- alt : WithOverrideImage . args . alt ,
241
- format : WithOverrideImage . args . format ,
242
- title : WithOverrideImage . args . title ,
243
- overrideImage : WithOverlayAndPosterImage . args . overrideImage ,
195
+ videoId : WithImage . args . videoId ,
196
+ alt : WithImage . args . alt ,
197
+ format : WithImage . args . format ,
198
+ title : WithImage . args . title ,
199
+ image : WithImage . args . image ,
244
200
} ,
245
201
render : function Render ( args ) {
246
202
const [ consented , setConsented ] = useState ( false ) ;
@@ -385,7 +341,6 @@ export const PausesOffscreen = {
385
341
* The ad enabled tests are a convenience for manual testing.
386
342
*
387
343
*/
388
-
389
344
export const NoConsentWithAds = {
390
345
args : {
391
346
...NoConsent . args ,
@@ -407,35 +362,10 @@ export const NoOverlayWithAds = {
407
362
} ,
408
363
} satisfies Story ;
409
364
410
- export const WithOverrideImageWithAds = {
411
- args : {
412
- ...WithOverrideImage . args ,
413
- ...adTargetingAndConsentGiven ,
414
- overrideImage : WithOverlayAndPosterImage . args . overrideImage ,
415
- } ,
416
- decorators : [ Container ] ,
417
- parameters : {
418
- chromatic : { disableSnapshot : true } ,
419
- } ,
420
- } satisfies Story ;
421
-
422
- export const WithPosterImageWithAds = {
423
- args : {
424
- ...WithPosterImage . args ,
425
- ...adTargetingAndConsentGiven ,
426
- } ,
427
- decorators : [ Container ] ,
428
- parameters : {
429
- chromatic : { disableSnapshot : true } ,
430
- } ,
431
- } satisfies Story ;
432
-
433
- export const WithOverlayAndPosterImageWithAds = {
365
+ export const WithimageWithAds = {
434
366
args : {
435
- ...WithOverlayAndPosterImage . args ,
367
+ ...WithImage . args ,
436
368
...adTargetingAndConsentGiven ,
437
- kicker : undefined ,
438
- showTextOverlay : undefined ,
439
369
} ,
440
370
decorators : [ Container ] ,
441
371
parameters : {
@@ -510,8 +440,7 @@ export const LiveStream = {
510
440
design : ArticleDesign . Standard ,
511
441
display : ArticleDisplay . Standard ,
512
442
} ,
513
- overrideImage :
514
- 'https://i.guim.co.uk/img/media/4b3808707ec341629932a9d443ff5a812cf4df14/0_309_1800_1081/master/1800.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=aff4b8255693eb449f13070df88e9cac' ,
443
+ image : 'https://i.guim.co.uk/img/media/4b3808707ec341629932a9d443ff5a812cf4df14/0_309_1800_1081/master/1800.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=aff4b8255693eb449f13070df88e9cac' ,
515
444
height : undefined ,
516
445
width : undefined ,
517
446
title : 'How to stop the spread of coronavirus' ,
0 commit comments