Skip to content

Commit

Permalink
✨ Add hotspot and crop back to image components #1752
Browse files Browse the repository at this point in the history
  • Loading branch information
millianapia committed Nov 17, 2023
1 parent 6e3340e commit 31aa647
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions web/lib/queries/common/pageContentFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,9 @@ const pageContentFields = /* groq */ `
_type == "figure"=>{
"type": _type,
"id": _key,
// For these images, we don't want crop and hotspot
// because we don't know the aspect ratio
"figure": figure{
_type,
"image": {
"asset": image.asset,
"alt": image.alt,
},
image,
attribution,
caption
},
Expand Down
4 changes: 2 additions & 2 deletions web/pageComponents/shared/SanityImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ const Image = ({
// Layout fill
props = {
fill,
style: { ...style, objectFit: 'cover' },
style: { objectFit: 'cover' },
}
} else {
// Layout responsive
props = {
width,
height,
style: { ...style, display: 'flex', width: '100%', height: 'auto' },
style: { display: 'flex', width: '100%', height: 'auto' },
}
}

Expand Down

0 comments on commit 31aa647

Please sign in to comment.