mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-06 15:59:47 -05:00
Fix avatar icon
This commit is contained in:
@@ -4,7 +4,7 @@ import { Row } from './layout/row'
|
||||
import clsx from 'clsx'
|
||||
|
||||
export const MultipleOrSingleAvatars = (props: {
|
||||
avatars: Array<{ avatarUrl: string; id: string }>
|
||||
avatars: Array<{ avatarUrl: string; id: string; name: string }>
|
||||
onClick?: () => void
|
||||
size: AvatarSizeType
|
||||
// TODO: standardize these numbers so they are calculated from the size
|
||||
@@ -17,7 +17,7 @@ export const MultipleOrSingleAvatars = (props: {
|
||||
if (avatars.length === 0) return null
|
||||
|
||||
if (avatars.length === 1) {
|
||||
return <Avatar size={size} avatarUrl={avatars[0].avatarUrl} />
|
||||
return <Avatar size={size} avatarUrl={avatars[0].avatarUrl} username={avatars[0].name} />
|
||||
}
|
||||
|
||||
const totalAvatars = avatars.length
|
||||
|
||||
@@ -43,14 +43,11 @@ export const Avatar = memo(
|
||||
Router.push(`/${username}`)
|
||||
}
|
||||
}
|
||||
|
||||
const fallbackInitial = (username || 'U')[0]; // first character, not encoded string
|
||||
const url: string = avatarUrl && avatarUrl.length > 0
|
||||
? avatarUrl
|
||||
: `https://ui-avatars.com/api/?name=${encodeURIComponent(fallbackInitial)}`;
|
||||
|
||||
|
||||
// console.debug(url)
|
||||
console.log(username, fallbackInitial, url)
|
||||
|
||||
// there can be no avatar URL or username in the feed, we show a "submit comment"
|
||||
// item with a fake grey user circle guy even if you aren't signed in
|
||||
|
||||
Reference in New Issue
Block a user