Skip to content

Commit

Permalink
New: Support for responsive menu item image sources (fixes #198) (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirsty-hames authored Jul 15, 2024
1 parent 447aaa3 commit 65ca0c1
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions templates/boxMenuItem.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Adapt from 'core/js/adapt';
import { classes, compile } from 'core/js/reactHelpers';
import { classes, compile, templates } from 'core/js/reactHelpers';

export default function BoxMenuItem (props) {

Expand Down Expand Up @@ -38,15 +38,11 @@ export default function BoxMenuItem (props) {
return (
<div className="menu-item__inner boxmenu-item__inner">

{_graphic?.src &&
<div className="menu-item__image-container boxmenu-item__image-container">
<img
className="menu-item__image boxmenu-item__image"
src={_graphic.src}
aria-hidden="true"
/>
</div>
}
<templates.image {..._graphic}
classNamePrefixes={['menu-item', 'boxmenu-item']}
alt={null}
attribution={null}
/>

<div className="menu-item__details boxmenu-item__details">
<div className="menu-item__details-inner boxmenu-item__details-inner">
Expand Down

0 comments on commit 65ca0c1

Please sign in to comment.