Skip to content

Commit 9676aff

Browse files
committed
Refactor image handling to use speakerImageUrl for consistent image processing in SpeakerPromotionCard, SpeakerShare, and SpeakerShareWrapper components
1 parent 2c5c81e commit 9676aff

3 files changed

Lines changed: 18 additions & 18 deletions

File tree

src/components/SpeakerPromotionCard.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
SparklesIcon,
1010
} from '@heroicons/react/24/outline'
1111
import { UserIcon, MicrophoneIcon, StarIcon } from '@heroicons/react/24/solid'
12-
import { sanityImage } from '@/lib/sanity/client'
12+
import { speakerImageUrl } from '@/lib/sanity/client'
1313
import { Format } from '@/lib/proposal/types'
1414
import { formatConfig } from '@/lib/proposal'
1515
import { SpeakerWithTalks } from '@/lib/speaker/types'
@@ -157,11 +157,11 @@ const SpeakerImage = ({
157157
if (image) {
158158
return (
159159
<img
160-
src={sanityImage(image)
161-
.width(size * 2)
162-
.height(size * 2)
163-
.fit('crop')
164-
.url()}
160+
src={speakerImageUrl(image, {
161+
width: size * 2,
162+
height: size * 2,
163+
fit: 'crop',
164+
})}
165165
alt={name}
166166
width={size}
167167
height={size}

src/components/SpeakerShare.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { MissingAvatar } from '@/components/common/MissingAvatar'
22
import { QrCodeIcon } from '@heroicons/react/24/outline'
33
import { MicrophoneIcon, StarIcon } from '@heroicons/react/24/solid'
4-
import { sanityImage } from '@/lib/sanity/client'
4+
import { speakerImageUrl } from '@/lib/sanity/client'
55
import { Format } from '@/lib/proposal/types'
66
import { formatConfig } from '@/lib/proposal'
77
import { SpeakerWithTalks } from '@/lib/speaker/types'
@@ -102,11 +102,11 @@ const SpeakerImage = ({
102102
if (image) {
103103
return (
104104
<img
105-
src={sanityImage(image)
106-
.width(size * 2)
107-
.height(size * 2)
108-
.fit('crop')
109-
.url()}
105+
src={speakerImageUrl(image, {
106+
width: size * 2,
107+
height: size * 2,
108+
fit: 'crop',
109+
})}
110110
alt={name}
111111
width={size}
112112
height={size}

src/components/cfp/SpeakerShareWrapper.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { SpeakerSharingActions } from '@/components/speaker/SpeakerSharingAction
44
import { MissingAvatar } from '@/components/common/MissingAvatar'
55
import { QrCodeIcon } from '@heroicons/react/24/outline'
66
import { MicrophoneIcon, StarIcon } from '@heroicons/react/24/solid'
7-
import { sanityImage } from '@/lib/sanity/client'
7+
import { speakerImageUrl } from '@/lib/sanity/client'
88
import { CloudNativePattern } from '@/components/CloudNativePattern'
99
import type { SpeakerShareClientProps } from '@/components/SpeakerShare'
1010
import { formatConfig, Format } from '@/lib/proposal'
@@ -95,11 +95,11 @@ export function SpeakerShareWrapper({
9595
<div className="shrink-0">
9696
{image ? (
9797
<img
98-
src={sanityImage(image)
99-
.width(800)
100-
.height(800)
101-
.fit('crop')
102-
.url()}
98+
src={speakerImageUrl(image, {
99+
width: 800,
100+
height: 800,
101+
fit: 'crop',
102+
})}
103103
alt={name}
104104
width={400}
105105
height={400}

0 commit comments

Comments
 (0)