@@ -13,6 +13,9 @@ const ImageWithZoom = class ImageWithZoom extends React.Component {
13
13
static propTypes = {
14
14
// alt: PropTypes.string,
15
15
carouselStore : PropTypes . object . isRequired ,
16
+ className : PropTypes . string ,
17
+ imageClassName : PropTypes . string ,
18
+ overlayClassName : PropTypes . string ,
16
19
spinner : PropTypes . func ,
17
20
src : PropTypes . string . isRequired ,
18
21
srcZoomed : PropTypes . string ,
@@ -21,6 +24,9 @@ const ImageWithZoom = class ImageWithZoom extends React.Component {
21
24
}
22
25
23
26
static defaultProps = {
27
+ className : null ,
28
+ imageClassName : null ,
29
+ overlayClassName : null ,
24
30
isPinchZoomEnabled : true ,
25
31
spinner : null ,
26
32
srcZoomed : null ,
@@ -264,6 +270,9 @@ const ImageWithZoom = class ImageWithZoom extends React.Component {
264
270
render ( ) {
265
271
const {
266
272
carouselStore,
273
+ className,
274
+ imageClassName,
275
+ overlayClassName,
267
276
isPinchZoomEnabled,
268
277
spinner,
269
278
src,
@@ -272,18 +281,25 @@ const ImageWithZoom = class ImageWithZoom extends React.Component {
272
281
...filteredProps
273
282
} = this . props ;
274
283
275
- const imageClassName = cn ( [
284
+ const newClassName = cn ( [
285
+ s . container ,
286
+ className ,
287
+ ] ) ;
288
+
289
+ const newImageClassName = cn ( [
276
290
s . image ,
277
291
'carousel__zoom-image' ,
292
+ imageClassName ,
278
293
] ) ;
279
294
280
- const overlayClassName = cn ( [
295
+ const newOverlayClassName = cn ( [
281
296
s . overlay ,
282
297
'carousel__zoom-image-overlay' ,
283
298
this . state . isHovering && s . hover ,
284
299
this . state . isZooming && s . zoom ,
285
300
this . state . isHovering && 'carousel__zoom-image-overlay--hovering' ,
286
301
this . state . isZooming && 'carousel__zoom-image-overlay--zooming' ,
302
+ overlayClassName ,
287
303
] ) ;
288
304
289
305
const overlayStyle = { } ;
@@ -293,17 +309,17 @@ const ImageWithZoom = class ImageWithZoom extends React.Component {
293
309
}
294
310
295
311
return (
296
- < Tag className = { s . container } { ...filteredProps } >
312
+ < Tag className = { newClassName } { ...filteredProps } >
297
313
< Image
298
- className = { imageClassName }
314
+ className = { newImageClassName }
299
315
tag = "div"
300
316
src = { src }
301
317
isBgImage
302
318
onLoad = { this . handleImageComplete }
303
319
onError = { this . handleImageComplete }
304
320
/>
305
321
< Image
306
- className = { overlayClassName }
322
+ className = { newOverlayClassName }
307
323
tag = "div"
308
324
src = { srcZoomed || src }
309
325
style = { overlayStyle }
0 commit comments