Skip to content

Commit

Permalink
Fix: Set default for _imageAlignment for popup images (fixes #149) (#150
Browse files Browse the repository at this point in the history
)

* provide a default display of _imageAlignment: "right" in the instance _imageAlignment isn't set

* only apply _imageAlignment class if item has image
  • Loading branch information
kirsty-hames authored Apr 29, 2024
1 parent 0ab9354 commit ccaee3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/hotgridPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function HotgridPopup(props) {
_isRound && 'is-round',
_isVisited && 'is-visited',
_isActive && 'is-active',
_imageAlignment && `align-image-${_imageAlignment}`
_graphic?.src && `align-image-${_imageAlignment || 'right'}`
])}
key={index}
data-index={index}
Expand Down Expand Up @@ -76,7 +76,7 @@ export default function HotgridPopup(props) {
</div>
</div>

{(_imageAlignment === 'right' || _imageAlignment === 'bottom') &&
{(_imageAlignment !== 'left' && _imageAlignment !== 'top') &&
<templates.image {...(_itemGraphic.src ? _itemGraphic : _graphic)}
classNamePrefixSeparator='__item-'
classNamePrefixes={['component-item', 'hotgrid-popup']}
Expand Down

0 comments on commit ccaee3f

Please sign in to comment.