Skip to content

Commit

Permalink
fix(ui): image resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
RaneHyv committed Mar 22, 2024
1 parent cc39df0 commit 9d1918e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
12 changes: 6 additions & 6 deletions frontend/src/components/blocks/Teaser/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import { isInternalURL } from '@plone/volto/helpers';
// import config from '@plone/volto/registry';

function findNameOfBiggestImage(images) {
let maxHeight = 0;
let objectNameWithMaxHeight = 'teaser';
let maxWidth = 0;
let objectNameWithMaxWidth = 'teaser';

for (const [key, value] of Object.entries(images)) {
if (value.height > maxHeight) {
maxHeight = value.height;
objectNameWithMaxHeight = key;
if (value.width > maxWidth) {
maxWidth = value.width;
objectNameWithMaxWidth = key;
}
}

return objectNameWithMaxHeight;
return objectNameWithMaxWidth;
}

export function getTeaserImageURL({ href, image }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,7 @@ const HeroCarousel = (props) => {
style={
image
? {
backgroundImage: `url(${getScaleUrl(
image,
'great',
)})`,
backgroundImage: `url(${getScaleUrl(image, 'huge')})`,
height: `${height}`,
// backgroundSize: 'fit',
backgroundPosition: 'center',
Expand Down

0 comments on commit 9d1918e

Please sign in to comment.