Skip to content

Commit

Permalink
fix: review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deodorhunter committed Feb 6, 2025
1 parent f9dad47 commit 983a594
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const ListingImage = ({
noWrapLink = false,
...imageProps
}) => {
if (!contentHasImage(item, !imageProps?.image_field)) {
if (!contentHasImage(item) && !imageProps?.image_field) {
if (showDefault) {
return (
<ListingImageWrapper item={item} noWrapLink={noWrapLink}>
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 @@ -21,7 +21,7 @@ export const CardPersona = ({
type,
isEditMode,
}) => {
const hasImage = contentHasImage(item, showImage);
const hasImage = contentHasImage(item) && showImage;

return (
<Card
Expand Down
4 changes: 2 additions & 2 deletions src/components/ItaliaTheme/View/Commons/GenericCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const GenericCard = ({
</>
);
const cooked_image_field = image_field || item.image_field;
const showImage = contentHasImage(item, showimage && cooked_image_field);
const showImage = showimage && contentHasImage(item) && cooked_image_field;

return item ? (
showImage ? (
Expand All @@ -62,7 +62,7 @@ const GenericCard = ({
<Image
item={item}
imageField={cooked_image_field}
alt={item.title ?? ''}
alt={''}
title={item.title}
/>
</figure>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ItaliaTheme/View/Commons/OfficeCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const OfficeCard = ({
}) => {
const intl = useIntl();
const Image = config.getComponent({ name: 'Image' }).component;
const showImage = contentHasImage(office, showimage);
const showImage = showimage && contentHasImage(office);

return (
<div
Expand Down
14 changes: 10 additions & 4 deletions src/helpers/images.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 983a594

Please sign in to comment.