Skip to content

Commit c97bfc4

Browse files
committed
fix: introduce color pallete for avatar
1 parent 9bca27a commit c97bfc4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

package/src/components/Poll/components/PollOption.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ export const PollOption = ({ option, showProgressBar = true }: PollOptionProps)
119119
<VoteButton option={option} />
120120
<Text style={[styles.text, { color: black }, text]}>{option.text}</Text>
121121
<View style={[styles.votesContainer, votesContainer]}>
122-
{relevantVotes.map((vote: PollVote) => (
123-
<UserAvatar user={vote.user} size='xs' showBorder key={vote.id} />
124-
))}
122+
{relevantVotes.map((vote: PollVote) =>
123+
vote.user ? <UserAvatar user={vote.user} size='xs' showBorder key={vote.id} /> : null,
124+
)}
125125
<Text style={{ color: black, marginLeft: 2 }}>{voteCountsByOption[option.id] || 0}</Text>
126126
</View>
127127
</View>

package/src/components/Poll/components/PollResults/PollVote.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const PollVote = ({ vote }: { vote: PollVoteClass }) => {
4343
return (
4444
<View style={[styles.voteContainer, container]}>
4545
<View style={styles.userContainer}>
46-
{!isAnonymous ? <UserAvatar user={vote.user} size='xs' showBorder /> : null}
46+
{!isAnonymous && vote.user ? <UserAvatar user={vote.user} size='xs' showBorder /> : null}
4747
<Text style={[styles.voteUserName, { color: black }, userName]}>
4848
{isAnonymous ? t('Anonymous') : (vote.user?.name ?? vote.user?.id)}
4949
</Text>

0 commit comments

Comments
 (0)