From dff0332dd0326b446a07d39f70df45aab178e4c4 Mon Sep 17 00:00:00 2001 From: Elijah Seed-Arita Date: Thu, 24 Jul 2025 11:22:19 -0700 Subject: fix: general profile component layout fixes, and ability to disable the inset border for UserAvatar (#8711) --- src/components/KnownFollowers.tsx | 16 ++++++++++------ src/screens/Profile/Header/Handle.tsx | 2 +- src/screens/Profile/Header/ProfileHeaderStandard.tsx | 2 +- src/screens/Profile/Header/Shell.tsx | 7 ++++--- src/view/com/util/UserAvatar.tsx | 6 ++++-- 5 files changed, 20 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/components/KnownFollowers.tsx b/src/components/KnownFollowers.tsx index c60d0f92e..28fb8f1f1 100644 --- a/src/components/KnownFollowers.tsx +++ b/src/components/KnownFollowers.tsx @@ -1,6 +1,10 @@ import React from 'react' import {View} from 'react-native' -import {AppBskyActorDefs, moderateProfile, ModerationOpts} from '@atproto/api' +import { + type AppBskyActorDefs, + moderateProfile, + type ModerationOpts, +} from '@atproto/api' import {msg, Plural, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -8,9 +12,9 @@ import {makeProfileLink} from '#/lib/routes/links' import {sanitizeDisplayName} from '#/lib/strings/display-names' import {UserAvatar} from '#/view/com/util/UserAvatar' import {atoms as a, useTheme} from '#/alf' -import {Link, LinkProps} from '#/components/Link' +import {Link, type LinkProps} from '#/components/Link' import {Text} from '#/components/Typography' -import * as bsky from '#/types/bsky' +import type * as bsky from '#/types/bsky' const AVI_SIZE = 30 const AVI_SIZE_SMALL = 20 @@ -137,9 +141,9 @@ function KnownFollowersInner({ <> 0 ? -8 : 0, }, ]}> ))} diff --git a/src/screens/Profile/Header/Handle.tsx b/src/screens/Profile/Header/Handle.tsx index cfbf430c4..f52b6d68e 100644 --- a/src/screens/Profile/Header/Handle.tsx +++ b/src/screens/Profile/Header/Handle.tsx @@ -23,7 +23,7 @@ export function ProfileHeaderHandle({ const blockHide = profile.viewer?.blocking || profile.viewer?.blockedBy return ( {profile.viewer?.followedBy && !blockHide ? ( diff --git a/src/screens/Profile/Header/ProfileHeaderStandard.tsx b/src/screens/Profile/Header/ProfileHeaderStandard.tsx index 5dbf32c57..3a076ddf6 100644 --- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx +++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx @@ -251,7 +251,7 @@ let ProfileHeaderStandard = ({ + style={[a.flex_col, a.gap_sm, a.pb_sm, live ? a.pt_sm : a.pt_2xs]}> {live.isActive && } @@ -260,7 +261,7 @@ export {ProfileHeaderShell} const styles = StyleSheet.create({ backBtnWrapper: { position: 'absolute', - left: 10, + left: 12, width: 30, height: 30, overflow: 'hidden', @@ -279,8 +280,8 @@ const styles = StyleSheet.create({ }, aviPosition: { position: 'absolute', - top: 110, - left: 10, + top: 104, + left: 16, }, avi: { width: 94, diff --git a/src/view/com/util/UserAvatar.tsx b/src/view/com/util/UserAvatar.tsx index 97cd831b3..e83921b0b 100644 --- a/src/view/com/util/UserAvatar.tsx +++ b/src/view/com/util/UserAvatar.tsx @@ -70,6 +70,7 @@ interface UserAvatarProps extends BaseUserAvatarProps { type: UserAvatarType moderation?: ModerationUI usePlainRNImage?: boolean + noBorder?: boolean onLoad?: () => void style?: StyleProp } @@ -219,6 +220,7 @@ let UserAvatar = ({ style, live, hideLiveBadge, + noBorder, }: UserAvatarProps): React.ReactNode => { const t = useTheme() const finalShape = overrideShape ?? (type === 'user' ? 'circle' : 'square') @@ -309,7 +311,7 @@ let UserAvatar = ({ onLoad={onLoad} /> )} - + {!noBorder && } {live && size > 16 && !hideLiveBadge && ( 32 ? 'small' : 'tiny'} /> )} @@ -318,7 +320,7 @@ let UserAvatar = ({ ) : ( - + {!noBorder && } {live && size > 16 && !hideLiveBadge && ( 32 ? 'small' : 'tiny'} /> )} -- cgit 1.4.1