Skip to content

Commit

Permalink
♻️ Remove style prop from sanityimage #1752
Browse files Browse the repository at this point in the history
  • Loading branch information
millianapia committed Jan 4, 2024
1 parent 31aa647 commit e3ca10e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
9 changes: 1 addition & 8 deletions web/pageComponents/shared/Hero/FiftyFiftyHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,7 @@ export const FiftyFiftyHero = ({ title, ingress, link, background, figure }: Her
<StyledHero background={background}>
<StyledMedia>
{figure && (
<Image
maxWidth={4096}
sizes="(max-width: 800px) 100vw, 800px"
image={figure.image}
fill
style={{ objectFit: 'cover' }}
priority
/>
<Image maxWidth={4096} sizes="(max-width: 800px) 100vw, 800px" image={figure.image} fill priority />
)}
</StyledMedia>
<StyledContent>
Expand Down
10 changes: 1 addition & 9 deletions web/pageComponents/shared/SanityImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,7 @@ export enum Ratios {
const DEFAULT_SIZES = '(max-width: 800px) 100vw, 800px'
const DEFAULT_MAX_WIDTH = 1440

const Image = ({
image,
aspectRatio,
sizes = DEFAULT_SIZES,
maxWidth = DEFAULT_MAX_WIDTH,
fill,
style,
...rest
}: Props) => {
const Image = ({ image, aspectRatio, sizes = DEFAULT_SIZES, maxWidth = DEFAULT_MAX_WIDTH, fill, ...rest }: Props) => {
const imageProps = useSanityLoader(image, maxWidth, aspectRatio)
if (!image?.asset) return <></>
const { width, height, src } = imageProps
Expand Down

0 comments on commit e3ca10e

Please sign in to comment.