diff --git a/src/components/AvatarBubbles.tsx b/src/components/AvatarBubbles.tsx index f9494d1805..894e1f34f5 100644 --- a/src/components/AvatarBubbles.tsx +++ b/src/components/AvatarBubbles.tsx @@ -10,7 +10,7 @@ import Animated, { } from 'react-native-reanimated' import {moderateProfile} from '@atproto/api' -import {useProfileShadow} from '#/state/cache/profile-shadow' +import {useMaybeProfileShadow} from '#/state/cache/profile-shadow' import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useSession} from '#/state/session' import {UserAvatar} from '#/view/com/util/UserAvatar' @@ -90,22 +90,18 @@ export function AvatarBubbles({ transform: [{scale}], transformOrigin: 'top left', }}> - {layouts.map((layout, i) => { - const profile = profiles[i] - if (!profile) return null - return ( - - ) - })} + {layouts.map((layout, i) => ( + + ))} ) @@ -120,7 +116,7 @@ function AvatarBubble({ zIndex, includeProfileBorder, }: { - profile: bsky.profile.AnyProfileView + profile?: bsky.profile.AnyProfileView scale: SharedValue size: number x: number @@ -133,42 +129,34 @@ function AvatarBubble({ transform: [{translateX: x}, {translateY: y}, {scale: scale.get()}], })) - const style = [ - a.absolute, - a.rounded_full, - a.flex_grow_0, - includeProfileBorder && { - borderColor: t.atoms.text_inverted.color, - borderWidth: 2, - }, - zIndex != null && {zIndex}, - animatedStyle, - ] - - const profile = useProfileShadow(profileUnshadowed) + const profile = useMaybeProfileShadow(profileUnshadowed) const moderationOpts = useModerationOpts() - if (!moderationOpts) { - return ( - - - - ) - } - - const moderation = moderateProfile(profile, moderationOpts) - const avatarModeration = moderation.ui('avatar') - return ( - - + + {profile && moderationOpts ? ( + + ) : ( + + )} ) }