diff --git a/packages/gallery/src/components/gallery/proGallery/slideshowView.js b/packages/gallery/src/components/gallery/proGallery/slideshowView.js index 40f217b28..e78db5158 100644 --- a/packages/gallery/src/components/gallery/proGallery/slideshowView.js +++ b/packages/gallery/src/components/gallery/proGallery/slideshowView.js @@ -434,20 +434,19 @@ class SlideshowView extends React.Component { } }; - findFirstIdx(itemIdx) { + getFirstIdx(itemIdx) { const activeItem = this.props.galleryStructure.galleryItems[itemIdx]; - const itemId = activeItem.itemId; - const firstItemInstance = this.props.galleryStructure.galleryItems.find((item) => item.itemId === itemId); - const firstItemInstanceIdx = firstItemInstance.idx; - return firstItemInstanceIdx; + const activeItemId = activeItem.itemId; + const firstItemInstance = this.props.galleryStructure.galleryItems.find((item) => item.itemId === activeItemId); + return firstItemInstance.idx; } scrollToThumbnail(itemIdx, scrollDuration) { //not to confuse with this.props.actions.scrollToItem. this is used to replace it only for thumbnail items this.props.actions.eventsListener(GALLERY_CONSTS.events.THUMBNAIL_CLICKED, this.props); - const activeItemFirstIdx = this.findFirstIdx(this.state.activeIndex); - const firstTargetItemIdx = this.findFirstIdx(itemIdx); + const activeItemFirstIdx = this.getFirstIdx(this.state.activeIndex); + const firstTargetItemIdx = this.getFirstIdx(itemIdx); const distance = firstTargetItemIdx - activeItemFirstIdx; const targetIdx = this.state.activeIndex + distance; diff --git a/packages/lib/src/core/helpers/thumbnailsLogic.ts b/packages/lib/src/core/helpers/thumbnailsLogic.ts index 4345dbc7e..7f57bfe9a 100644 --- a/packages/lib/src/core/helpers/thumbnailsLogic.ts +++ b/packages/lib/src/core/helpers/thumbnailsLogic.ts @@ -109,7 +109,7 @@ function getThumbnailsData({ height, thumbnailSizeWithSpacing, activeIndex: activeIndexWithOffset, - numberOfGalleryItems: galleryItems.length, + itemsCount: galleryItems.length, }); const thumbnailsStyleWithRTLCalc = isRTL @@ -194,14 +194,14 @@ function getThumbnailsStyles({ height, activeIndex, thumbnailSizeWithSpacing, - numberOfGalleryItems: numberOfItems, + itemsCount: numberOfItems, }: { horizontalThumbnails: boolean; width: number; height: number; activeIndex: number; thumbnailSizeWithSpacing: number; - numberOfGalleryItems: number; + itemsCount: number; }): any { const baseStyle = { overflow: 'visible',