Skip to content

Commit

Permalink
Fix avatar shape in Account switch menu (bluesky-social#7388)
Browse files Browse the repository at this point in the history
  • Loading branch information
mozzius authored Jan 9, 2025
1 parent a0393fc commit d10cbb8
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/components/AccountList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ function AccountItem({
(hovered || pressed || isPendingAccount) && t.atoms.bg_contrast_25,
]}>
<View style={a.p_md}>
<UserAvatar avatar={profile?.avatar} size={24} />
<UserAvatar
avatar={profile?.avatar}
size={24}
type={profile?.associated?.labeler ? 'labeler' : 'user'}
/>
</View>
<Text style={[a.align_baseline, a.flex_1, a.flex_row, a.py_sm]}>
<Text emoji style={[a.font_bold]}>
Expand Down
1 change: 1 addition & 0 deletions src/components/AvatarStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export function AvatarStack({
<UserAvatar
size={size - 2}
avatar={item.profile.avatar}
type={item.profile.associated?.labeler ? 'labeler' : 'user'}
moderation={item.moderation.ui('avatar')}
/>
)}
Expand Down
1 change: 1 addition & 0 deletions src/components/KnownFollowers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ function KnownFollowersInner({
size={SIZE}
avatar={prof.avatar}
moderation={moderation.ui('avatar')}
type={prof.associated?.labeler ? 'labeler' : 'user'}
/>
</View>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Pills.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function Label({
fill={t.atoms.text_contrast_medium.color}
/>
) : (
<UserAvatar avatar={desc.sourceAvi} size={avi} />
<UserAvatar avatar={desc.sourceAvi} type="user" size={avi} />
)}

<Text
Expand Down
2 changes: 2 additions & 0 deletions src/screens/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ function ProfilePreview({
size={80}
avatar={shadow.avatar}
moderation={moderation.ui('avatar')}
type={shadow.associated?.labeler ? 'labeler' : 'user'}
/>
<ProfileHeaderDisplayName profile={shadow} moderation={moderation} />
<ProfileHeaderHandle profile={shadow} />
Expand Down Expand Up @@ -414,6 +415,7 @@ function AccountRow({
size={28}
avatar={profile.avatar}
moderation={moderateProfile(profile, moderationOpts).ui('avatar')}
type={profile.associated?.labeler ? 'labeler' : 'user'}
/>
) : (
<View style={[{width: 28}]} />
Expand Down
12 changes: 10 additions & 2 deletions src/view/com/post-thread/PostThreadLoadMore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ export function PostThreadLoadMore({post}: {post: AppBskyFeedDefs.PostView}) {
backgroundColor: t.atoms.bg.backgroundColor,
marginRight: -20,
}}>
<UserAvatar avatar={post.author.avatar} size={30} />
<UserAvatar
avatar={post.author.avatar}
size={30}
type={post.author.associated?.labeler ? 'labeler' : 'user'}
/>
</View>
<View
style={{
Expand All @@ -44,7 +48,11 @@ export function PostThreadLoadMore({post}: {post: AppBskyFeedDefs.PostView}) {
borderRadius: 18,
backgroundColor: t.atoms.bg.backgroundColor,
}}>
<UserAvatar avatar={post.author.avatar} size={30} />
<UserAvatar
avatar={post.author.avatar}
size={30}
type={post.author.associated?.labeler ? 'labeler' : 'user'}
/>
</View>
</View>
<View style={[a.px_sm]}>
Expand Down
8 changes: 7 additions & 1 deletion src/view/com/util/UserAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ interface BaseUserAvatarProps {
}

interface UserAvatarProps extends BaseUserAvatarProps {
type: UserAvatarType
moderation?: ModerationUI
usePlainRNImage?: boolean
onLoad?: () => void
Expand Down Expand Up @@ -439,7 +440,12 @@ let PreviewableUserAvatar = ({
handle: profile.handle,
})}
onPress={onPress}>
<UserAvatar avatar={profile.avatar} moderation={moderation} {...rest} />
<UserAvatar
avatar={profile.avatar}
moderation={moderation}
type={profile.associated?.labeler ? 'labeler' : 'user'}
{...rest}
/>
</Link>
</ProfileHoverCard>
)
Expand Down
1 change: 1 addition & 0 deletions src/view/screens/Search/Explore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ function LoadMore({
size={28}
avatar={_item.avatar}
moderation={_item.moderation.ui('avatar')}
type="user"
/>
) : _item.type === 'feed' ? (
<UserAvatar
Expand Down

0 comments on commit d10cbb8

Please sign in to comment.