Skip to content

Commit 394102b

Browse files
committed
Fix avatar icon
1 parent 3585b12 commit 394102b

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

web/components/multiple-or-single-avatars.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Row } from './layout/row'
44
import clsx from 'clsx'
55

66
export const MultipleOrSingleAvatars = (props: {
7-
avatars: Array<{ avatarUrl: string; id: string }>
7+
avatars: Array<{ avatarUrl: string; id: string; name: string }>
88
onClick?: () => void
99
size: AvatarSizeType
1010
// TODO: standardize these numbers so they are calculated from the size
@@ -17,7 +17,7 @@ export const MultipleOrSingleAvatars = (props: {
1717
if (avatars.length === 0) return null
1818

1919
if (avatars.length === 1) {
20-
return <Avatar size={size} avatarUrl={avatars[0].avatarUrl} />
20+
return <Avatar size={size} avatarUrl={avatars[0].avatarUrl} username={avatars[0].name} />
2121
}
2222

2323
const totalAvatars = avatars.length

web/components/widgets/avatar.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,11 @@ export const Avatar = memo(
4343
Router.push(`/${username}`)
4444
}
4545
}
46-
4746
const fallbackInitial = (username || 'U')[0]; // first character, not encoded string
4847
const url: string = avatarUrl && avatarUrl.length > 0
4948
? avatarUrl
5049
: `https://ui-avatars.com/api/?name=${encodeURIComponent(fallbackInitial)}`;
51-
52-
53-
// console.debug(url)
50+
console.log(username, fallbackInitial, url)
5451

5552
// there can be no avatar URL or username in the feed, we show a "submit comment"
5653
// item with a fake grey user circle guy even if you aren't signed in

0 commit comments

Comments
 (0)