From 30df0d4484ca509823979ebf701d505ffc4101cb Mon Sep 17 00:00:00 2001 From: noam-heller1 Date: Wed, 19 Jul 2023 17:15:09 +0300 Subject: [PATCH] fix on-gallery navigation panel to be on-image --- .../components/gallery/proGallery/navigationPanel.js | 12 ++++++++++-- .../components/gallery/proGallery/slideshowView.js | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/gallery/src/components/gallery/proGallery/navigationPanel.js b/packages/gallery/src/components/gallery/proGallery/navigationPanel.js index 0f9b5cb3a..23144ecea 100644 --- a/packages/gallery/src/components/gallery/proGallery/navigationPanel.js +++ b/packages/gallery/src/components/gallery/proGallery/navigationPanel.js @@ -201,6 +201,7 @@ export const getCustomNavigationPanelInlineStyles = ({ galleryWidth, height, width, + infoHeight, galleryThumbnailsAlignment, navigationPanelPosition, }) => { @@ -216,16 +217,23 @@ export const getCustomNavigationPanelInlineStyles = ({ ...getNavigationPanelOnGalleryPositionStyles({ galleryThumbnailsAlignment, navigationPanelPosition, + infoHeight, }), overflow: 'hidden', float: 'left', }; }; -const getNavigationPanelOnGalleryPositionStyles = ({ galleryThumbnailsAlignment, navigationPanelPosition }) => { +const getNavigationPanelOnGalleryPositionStyles = ({ + galleryThumbnailsAlignment, + navigationPanelPosition, + infoHeight, +}) => { if (navigationPanelPosition === GALLERY_CONSTS[optionsMap.layoutParams.thumbnails.position].ON_GALLERY) { let onGalleryStyles = { position: 'absolute' }; - onGalleryStyles[galleryThumbnailsAlignment.toLowerCase()] = 0; + if (galleryThumbnailsAlignment === GALLERY_CONSTS[optionsMap.layoutParams.thumbnails.alignment].BOTTOM) { + onGalleryStyles['bottom'] = infoHeight; + } return onGalleryStyles; } }; diff --git a/packages/gallery/src/components/gallery/proGallery/slideshowView.js b/packages/gallery/src/components/gallery/proGallery/slideshowView.js index 0251daff8..8d83cc6e1 100644 --- a/packages/gallery/src/components/gallery/proGallery/slideshowView.js +++ b/packages/gallery/src/components/gallery/proGallery/slideshowView.js @@ -915,11 +915,13 @@ class SlideshowView extends React.Component { let navigationPanel; if (customNavigationPanelRenderer) { const { galleryHeight, galleryWidth, height, width } = this.props.container; + const infoHeight = this.props.options.layoutParams_info_height; const customNavigationPanelInlineStyles = getCustomNavigationPanelInlineStyles({ galleryHeight, galleryWidth, height, width, + infoHeight, galleryThumbnailsAlignment: this.props.options.layoutParams_thumbnails_alignment, navigationPanelPosition: this.props.options.layoutParams_thumbnails_position, });