diff --git a/app/components/sections/organizers/organizers.tsx b/app/components/sections/organizers/organizers.tsx index fa5ace8..e03e50f 100644 --- a/app/components/sections/organizers/organizers.tsx +++ b/app/components/sections/organizers/organizers.tsx @@ -5,7 +5,7 @@ import { OurTeamCard, type OurTeamCardProps, } from "~/components/shared/card/our-team"; -import { cn, parseOrganizerImage } from "~/lib/utils"; +import { cn, parseOrganizerImage, parseVolunteerImage } from "~/lib/utils"; interface OrganizersSectionProps { organizers: OrganizerPublicType[]; @@ -86,7 +86,7 @@ export const OrganizersSection = ({ id: volunteerItem.id, name: getFullName(volunteerItem), email: volunteerItem?.user?.email || undefined, - profile_picture: parseOrganizerImage({ id: volunteerItem.id }), + profile_picture: parseVolunteerImage({ id: volunteerItem.id }), twitter_username: (volunteerItem?.user?.twitter_username && `https://twitter.com/${volunteerItem?.user?.twitter_username}`) || diff --git a/app/lib/utils.ts b/app/lib/utils.ts index 1416b71..13f4e11 100644 --- a/app/lib/utils.ts +++ b/app/lib/utils.ts @@ -31,6 +31,12 @@ export const parseOrganizerImage = ({ id }: { id: string }) => { return `${url}/organizer/${id}/profile-picture`; }; +export const parseVolunteerImage = ({ id }: { id: string }) => { + if (!id) return ""; + const url = import.meta.env.VITE_BASE_API; + return `${url}/volunteer/${id}/profile-picture/`; +}; + export const onAvatarError = ( evt: React.SyntheticEvent, ) => {