Skip to content

Commit

Permalink
Try to prevent double onClick
Browse files Browse the repository at this point in the history
  • Loading branch information
ProLoser committed Oct 9, 2024
1 parent cc40312 commit a649a4d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ export type AvatarProps = {
}

export default function Avatar({ user, onClick }: AvatarProps) {
return user
? <img className="avatar" onClick={onClick} src={user.photoURL || `https://i.pravatar.cc/100?u=${user.uid}`} alt={user.name} />
: <img className="avatar" onClick={onClick} src="https://i.pravatar.cc/100" />
return <img className="avatar" onClick={onClick} src={user ? user.photoURL || `https://i.pravatar.cc/100?u=${user.uid}` : 'https://i.pravatar.cc/100'} alt={user?.name} />
}

0 comments on commit a649a4d

Please sign in to comment.