@trafilea/afrodita-components 6.43.8 → 6.43.9

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.
package/build/index.js CHANGED
@@ -21564,7 +21564,7 @@ var Container$5 = newStyled.div({
21564
21564
  width: '100vw',
21565
21565
  position: 'fixed',
21566
21566
  overflowY: 'scroll',
21567
- zIndex: '99999',
21567
+ zIndex: '99999999999',
21568
21568
  top: 0,
21569
21569
  left: 0,
21570
21570
  display: 'flex',
@@ -21635,13 +21635,19 @@ var GalleryDetailed = function (_a) {
21635
21635
  };
21636
21636
 
21637
21637
  var ProductGalleryMobileV4 = function (_a) {
21638
- var images = _a.images, customClick = _a.customClick, topTag = _a.topTag, topRightTag = _a.topRightTag, bottomTag = _a.bottomTag, productImageDataTestId = _a.productImageDataTestId, _b = _a.borderRadiusVariant, borderRadiusVariant = _b === void 0 ? false : _b, _c = _a.selectedValue, selectedValue = _c === void 0 ? 0 : _c, _d = _a.itemsOnViewport, itemsOnViewport = _d === void 0 ? 1 : _d;
21638
+ var images = _a.images, customClick = _a.customClick, topTag = _a.topTag, topRightTag = _a.topRightTag, bottomTag = _a.bottomTag, productImageDataTestId = _a.productImageDataTestId, _b = _a.borderRadiusVariant, borderRadiusVariant = _b === void 0 ? false : _b, _c = _a.selectedIndex, selectedIndex = _c === void 0 ? 0 : _c, selectedValue = _a.selectedValue, _d = _a.itemsOnViewport, itemsOnViewport = _d === void 0 ? 1 : _d;
21639
21639
  var containerRef = React$2.useRef(null);
21640
- var _e = React$2.useState(selectedValue), selectedImageIndex = _e[0], setSelectedImageIndex = _e[1];
21640
+ var _e = React$2.useState(selectedIndex), selectedImageIndex = _e[0], setSelectedImageIndex = _e[1];
21641
21641
  var _f = React$2.useState(false), galleryOpened = _f[0], setGalleryOpened = _f[1];
21642
21642
  React$2.useEffect(function () {
21643
- setSelectedImageIndex(selectedValue);
21644
- }, [selectedValue]);
21643
+ if (selectedIndex) {
21644
+ setSelectedImageIndex(selectedIndex);
21645
+ }
21646
+ else if (selectedValue) {
21647
+ var actualIndex = images.findIndex(function (el) { return el.key === selectedValue.key; });
21648
+ setSelectedImageIndex(actualIndex);
21649
+ }
21650
+ }, [selectedIndex, selectedValue, images]);
21645
21651
  React$2.useEffect(function () {
21646
21652
  var body = document.querySelector('body');
21647
21653
  if (!body) {