stream-chat-react 10.22.1 → 10.22.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ModalGallery.d.ts","sourceRoot":"","sources":["../../../src/components/Gallery/ModalGallery.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,oBAAY,iBAAiB,CAC3B,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,IAC9E;IACF,4CAA4C;IAC5C,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;IACzC,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,YAAY,iJA8BxB,CAAC"}
1
+ {"version":3,"file":"ModalGallery.d.ts","sourceRoot":"","sources":["../../../src/components/Gallery/ModalGallery.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,oBAAY,iBAAiB,CAC3B,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,IAC9E;IACF,4CAA4C;IAC5C,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;IACzC,kCAAkC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAYF,eAAO,MAAM,YAAY,iJA+BxB,CAAC"}
@@ -1,6 +1,16 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import ImageGallery from 'react-image-gallery';
3
+ import { BaseImage } from './BaseImage';
3
4
  import { useTranslationContext } from '../../context';
5
+ var onError = function (e) {
6
+ // Prevent having alt attribute on img as the img takes the height of the alt text
7
+ // instead of the CSS / element width & height when the CSS mask (fallback) is applied.
8
+ e.target.alt = '';
9
+ };
10
+ var renderItem = function (_a) {
11
+ var original = _a.original, originalAlt = _a.originalAlt;
12
+ return (React.createElement(BaseImage, { alt: originalAlt, className: 'image-gallery-image', onError: onError, src: original }));
13
+ };
4
14
  export var ModalGallery = function (props) {
5
15
  var images = props.images, index = props.index;
6
16
  var t = useTranslationContext('ModalGallery').t;
@@ -14,5 +24,5 @@ export var ModalGallery = function (props) {
14
24
  };
15
25
  });
16
26
  }, [images]);
17
- return (React.createElement(ImageGallery, { items: formattedArray, showIndex: true, showPlayButton: false, showThumbnails: false, startIndex: index }));
27
+ return (React.createElement(ImageGallery, { items: formattedArray, renderItem: renderItem, showIndex: true, showPlayButton: false, showThumbnails: false, startIndex: index }));
18
28
  };