Skip to content

Commit

Permalink
fix: image_filed removed as condition to show title/alt
Browse files Browse the repository at this point in the history
  • Loading branch information
Wagner3UB committed Feb 7, 2025
1 parent 1c4f336 commit b7c81db
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const CardWithImageDefault = (props) => {
})}
>
<div className="img-responsive img-responsive-panoramic">
<ListingImage item={item} showTitleAttr={false} />
<ListingImage item={item} />
{item['@type'] === 'Event' && (
<CardCalendar
start={item.start}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,11 @@ const ListingImage = ({
const Image = config.getComponent({ name: 'Image' }).component;

//Verifies if the item has a preview image or an header image
const showTitleAttr = !!(
(item.hasPreviewImage && item.preview_caption) ||
(item.image_field && item.image_caption)
);
const showTitleAttr = !!(item.hasPreviewImage && item.preview_caption);

//Verifies with caption to show as alt and title text
const imageCaption =
item.hasPreviewImage && item.preview_caption
? item.preview_caption
: item.image_field && item.image_caption
? item.image_caption
: null;
item.hasPreviewImage && item.preview_caption ? item.preview_caption : null;

let commonImageProps = {
item,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const CompleteBlockLinksTemplate = (props) => {
item={item}
className=""
sizes="60px"
showTitleAttr={false}
alt={item.title}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const ContentInEvidenceTemplate = (props) => {
className="item-image"
loading="eager"
sizes="(max-width:425px) 400px, (max-width:767px) 520px, 650px"
showTitleAttr={false}
/>
</Col>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ const InEvidenceTemplate = (props) => {
<ListingImage
item={item}
sizes="(max-width:320px) 200px, 300px"
showTitleAttr={false}
/>
{item['@type'] === 'Event' && (
<CardCalendar start={item.start} end={item.end} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/ItaliaTheme/Cards/CardPersona.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const CardPersona = ({
</CardBody>
{hasImage && (
<div className="card-image card-image-rounded">
<ListingImage item={item} sizes="130px" showTitleAttr={false} />
<ListingImage item={item} sizes="130px" />
</div>
)}
</div>
Expand Down

0 comments on commit b7c81db

Please sign in to comment.