Skip to content

Commit 315e579

Browse files
committed
Integrate SpeakerAvatars component into SponsorCard for improved assignee display
1 parent 463b480 commit 315e579

2 files changed

Lines changed: 16 additions & 25 deletions

File tree

src/components/SpeakerAvatars.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { sanityImage } from '@/lib/sanity/client'
21
import { Speaker } from '@/lib/speaker/types'
32
import { formatSpeakerNames } from '@/lib/speaker/formatSpeakerNames'
43
import { MissingAvatar } from '@/components/common/MissingAvatar'
@@ -112,11 +111,7 @@ export function SpeakerAvatars({
112111
>
113112
{speaker.image ? (
114113
<img
115-
src={sanityImage(speaker.image)
116-
.width(imageDimensions[size].width)
117-
.height(imageDimensions[size].height)
118-
.fit('crop')
119-
.url()}
114+
src={speaker.image}
120115
alt={speaker.name}
121116
className="absolute inset-0 h-full w-full rounded-full object-cover object-center"
122117
/>

src/components/admin/sponsor-crm/SponsorCard.tsx

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import type {
55
SponsorTag,
66
SignatureStatus,
77
} from '@/lib/sponsor-crm/types'
8+
import type { Speaker } from '@/lib/speaker/types'
89
import { SponsorLogo } from '@/components/SponsorLogo'
9-
import { MissingAvatar } from '@/components/common/MissingAvatar'
10+
import { SpeakerAvatars } from '@/components/SpeakerAvatars'
1011
import { formatNumber } from '@/lib/format'
1112
import {
1213
PencilIcon,
@@ -185,24 +186,19 @@ export function SponsorCard({
185186
</div>
186187
{/* Assignee */}
187188
{sponsor.assignedTo && (
188-
<div
189-
className="relative h-6 w-6 shrink-0 overflow-hidden rounded-full border border-gray-200/60 shadow-sm dark:border-gray-600"
190-
title={sponsor.assignedTo.name}
191-
>
192-
{sponsor.assignedTo.image ? (
193-
<img
194-
src={sponsor.assignedTo.image}
195-
alt={sponsor.assignedTo.name}
196-
className="h-full w-full object-cover"
197-
/>
198-
) : (
199-
<MissingAvatar
200-
name={sponsor.assignedTo.name}
201-
size={24}
202-
className="rounded-full"
203-
textSizeClass="text-[10px]"
204-
/>
205-
)}
189+
<div className="scale-[0.8] transform">
190+
<SpeakerAvatars
191+
speakers={[
192+
{
193+
_id: sponsor.assignedTo._id,
194+
name: sponsor.assignedTo.name,
195+
image: sponsor.assignedTo.image,
196+
} as Speaker,
197+
]}
198+
size="sm"
199+
maxVisible={1}
200+
showTooltip={true}
201+
/>
206202
</div>
207203
)}
208204
</div>

0 commit comments

Comments
 (0)