Skip to content

Commit

Permalink
quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shadrach-tayo committed Nov 7, 2024
1 parent ffa050d commit 370ee9a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/molecules/CommunityMembers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ export default function CommunityMembers({
>
<div className="flex items-center gap-4">
<Avatar>
<AvatarFallback>{getNameTag(member.user.name)}</AvatarFallback>
<AvatarFallback>{getNameTag(member?.user?.name)}</AvatarFallback>
</Avatar>
<div>
<p className="font-medium">{member.user.name}</p>
<p className="font-medium">{member?.user?.name}</p>
<p className="text-sm text-muted-foreground">{member.role}</p>
</div>
</div>
Expand All @@ -215,6 +215,7 @@ export default function CommunityMembers({
}

const getNameTag = (name: string) => {
if (!name) return 'ANON'
const split = name?.split(" ");
return (split[0]?.[0] ?? "") + (split?.[1]?.[0] ?? "");
};

0 comments on commit 370ee9a

Please sign in to comment.