Skip to content

Commit

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

* set default for _imageAlignment for popup images

* align _imageAlignment for popup images with schema defaults

schema defaults to 'right'

* refine _imageAlignment condition

Co-authored-by: Oliver Foster <oliver.foster@kineo.com>

* only apply _imageAlignment class if item has image

---------

Co-authored-by: Oliver Foster <oliver.foster@kineo.com>
  • Loading branch information
kirsty-hames and oliverfoster authored Apr 26, 2024
1 parent d6aec3d commit 1f00c26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/hotgraphicPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function HotgraphicPopup(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 HotgraphicPopup(props) {
</div>
</div>

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

0 comments on commit 1f00c26

Please sign in to comment.