Loosen types

This commit is contained in:
Eric Bailey
2025-02-11 10:17:10 -06:00
parent bf5f604ac1
commit 1a210accf4
4 changed files with 27 additions and 52 deletions
+3 -2
View File
@@ -10,6 +10,7 @@ import {UserAvatar} from '#/view/com/util/UserAvatar'
import {atoms as a, useTheme} from '#/alf'
import {Link, LinkProps} from '#/components/Link'
import {Text} from '#/components/Typography'
import * as bsky from '#/types/bsky'
const AVI_SIZE = 30
const AVI_SIZE_SMALL = 20
@@ -33,7 +34,7 @@ export function KnownFollowers({
onLinkPress,
minimal,
}: {
profile: AppBskyActorDefs.ProfileViewDetailed
profile: bsky.profile.AnyProfileView
moderationOpts: ModerationOpts
onLinkPress?: LinkProps['onPress']
minimal?: boolean
@@ -77,7 +78,7 @@ function KnownFollowersInner({
onLinkPress,
minimal,
}: {
profile: AppBskyActorDefs.ProfileViewDetailed
profile: bsky.profile.AnyProfileView
moderationOpts: ModerationOpts
cachedKnownFollowers: AppBskyActorDefs.KnownFollowers
onLinkPress?: LinkProps['onPress']
+22 -27
View File
@@ -77,6 +77,7 @@ export function ProfileCard({
showKnownFollowers &&
shouldShowKnownFollowers(profile.viewer?.knownFollowers) &&
moderationOpts
const hasDescription = 'description' in profile
return (
<Link
@@ -127,35 +128,29 @@ export function ProfileCard({
<View style={styles.layoutButton}>{renderButton(profile)}</View>
) : undefined}
</View>
{atp.profile.isView(profile) || atp.profile.isDetailedView(profile) ? (
<>
{profile.description || knownFollowersVisible ? (
<View style={styles.details}>
{profile.description ? (
<Text emoji style={pal.text} numberOfLines={4}>
{profile.description as string}
</Text>
) : null}
{knownFollowersVisible ? (
<View
style={[
a.flex_row,
a.align_center,
a.gap_sm,
!!profile.description && a.mt_md,
]}>
{atp.profile.isDetailedView(profile) && (
<KnownFollowers
minimal
profile={profile}
moderationOpts={moderationOpts}
/>
)}
</View>
) : null}
{hasDescription || knownFollowersVisible ? (
<View style={styles.details}>
{hasDescription && profile.description ? (
<Text emoji style={pal.text} numberOfLines={4}>
{profile.description as string}
</Text>
) : null}
{knownFollowersVisible ? (
<View
style={[
a.flex_row,
a.align_center,
a.gap_sm,
!!hasDescription && a.mt_md,
]}>
<KnownFollowers
minimal
profile={profile}
moderationOpts={moderationOpts}
/>
</View>
) : null}
</>
</View>
) : null}
</Link>
)