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
+1
View File
@@ -266,6 +266,7 @@
"webpack-bundle-analyzer": "^4.10.1" "webpack-bundle-analyzer": "^4.10.1"
}, },
"resolutions": { "resolutions": {
"@atproto/lexicon": "0.4.6-next.5",
"@expo/image-utils": "0.6.3", "@expo/image-utils": "0.6.3",
"@react-native/babel-preset": "0.76.1", "@react-native/babel-preset": "0.76.1",
"@react-native/normalize-colors": "0.76.1", "@react-native/normalize-colors": "0.76.1",
+3 -2
View File
@@ -10,6 +10,7 @@ import {UserAvatar} from '#/view/com/util/UserAvatar'
import {atoms as a, useTheme} from '#/alf' import {atoms as a, useTheme} from '#/alf'
import {Link, LinkProps} from '#/components/Link' import {Link, LinkProps} from '#/components/Link'
import {Text} from '#/components/Typography' import {Text} from '#/components/Typography'
import * as bsky from '#/types/bsky'
const AVI_SIZE = 30 const AVI_SIZE = 30
const AVI_SIZE_SMALL = 20 const AVI_SIZE_SMALL = 20
@@ -33,7 +34,7 @@ export function KnownFollowers({
onLinkPress, onLinkPress,
minimal, minimal,
}: { }: {
profile: AppBskyActorDefs.ProfileViewDetailed profile: bsky.profile.AnyProfileView
moderationOpts: ModerationOpts moderationOpts: ModerationOpts
onLinkPress?: LinkProps['onPress'] onLinkPress?: LinkProps['onPress']
minimal?: boolean minimal?: boolean
@@ -77,7 +78,7 @@ function KnownFollowersInner({
onLinkPress, onLinkPress,
minimal, minimal,
}: { }: {
profile: AppBskyActorDefs.ProfileViewDetailed profile: bsky.profile.AnyProfileView
moderationOpts: ModerationOpts moderationOpts: ModerationOpts
cachedKnownFollowers: AppBskyActorDefs.KnownFollowers cachedKnownFollowers: AppBskyActorDefs.KnownFollowers
onLinkPress?: LinkProps['onPress'] onLinkPress?: LinkProps['onPress']
+22 -27
View File
@@ -77,6 +77,7 @@ export function ProfileCard({
showKnownFollowers && showKnownFollowers &&
shouldShowKnownFollowers(profile.viewer?.knownFollowers) && shouldShowKnownFollowers(profile.viewer?.knownFollowers) &&
moderationOpts moderationOpts
const hasDescription = 'description' in profile
return ( return (
<Link <Link
@@ -127,35 +128,29 @@ export function ProfileCard({
<View style={styles.layoutButton}>{renderButton(profile)}</View> <View style={styles.layoutButton}>{renderButton(profile)}</View>
) : undefined} ) : undefined}
</View> </View>
{atp.profile.isView(profile) || atp.profile.isDetailedView(profile) ? ( {hasDescription || knownFollowersVisible ? (
<> <View style={styles.details}>
{profile.description || knownFollowersVisible ? ( {hasDescription && profile.description ? (
<View style={styles.details}> <Text emoji style={pal.text} numberOfLines={4}>
{profile.description ? ( {profile.description as string}
<Text emoji style={pal.text} numberOfLines={4}> </Text>
{profile.description as string} ) : null}
</Text> {knownFollowersVisible ? (
) : null} <View
{knownFollowersVisible ? ( style={[
<View a.flex_row,
style={[ a.align_center,
a.flex_row, a.gap_sm,
a.align_center, !!hasDescription && a.mt_md,
a.gap_sm, ]}>
!!profile.description && a.mt_md, <KnownFollowers
]}> minimal
{atp.profile.isDetailedView(profile) && ( profile={profile}
<KnownFollowers moderationOpts={moderationOpts}
minimal />
profile={profile}
moderationOpts={moderationOpts}
/>
)}
</View>
) : null}
</View> </View>
) : null} ) : null}
</> </View>
) : null} ) : null}
</Link> </Link>
) )
+1 -23
View File
@@ -282,7 +282,7 @@
multiformats "^9.9.0" multiformats "^9.9.0"
zod "^3.23.8" zod "^3.23.8"
"@atproto/lexicon@0.4.6-next.5", "@atproto/lexicon@^0.4.6-next.5": "@atproto/lexicon@0.4.6-next.5", "@atproto/lexicon@^0.4.4", "@atproto/lexicon@^0.4.5", "@atproto/lexicon@^0.4.6-next.5":
version "0.4.6-next.5" version "0.4.6-next.5"
resolved "https://registry.yarnpkg.com/@atproto/lexicon/-/lexicon-0.4.6-next.5.tgz#433a941cf8902afec15135f70cf2cbed37c35406" resolved "https://registry.yarnpkg.com/@atproto/lexicon/-/lexicon-0.4.6-next.5.tgz#433a941cf8902afec15135f70cf2cbed37c35406"
integrity sha512-Id1atQ1rZ3dUGAUyBcauD+zs5lGHSmoAlC1Kwb2DEvkaWMv3oTXUjtdQxyb0/Kz4YaFI+nxLLRH9NBO+BipG+w== integrity sha512-Id1atQ1rZ3dUGAUyBcauD+zs5lGHSmoAlC1Kwb2DEvkaWMv3oTXUjtdQxyb0/Kz4YaFI+nxLLRH9NBO+BipG+w==
@@ -293,28 +293,6 @@
multiformats "^9.9.0" multiformats "^9.9.0"
zod "^3.23.8" zod "^3.23.8"
"@atproto/lexicon@^0.4.4":
version "0.4.4"
resolved "https://registry.yarnpkg.com/@atproto/lexicon/-/lexicon-0.4.4.tgz#0d97314bb57b693b76f2495fa5e02872469dd93a"
integrity sha512-QFEmr3rpj/RoAmfX9ALU/asBG/rsVtQZnw+9nOB1/AuIwoxXd+ZyndR6lVUc2+DL4GEjl6W2yvBru5xbQIZWyA==
dependencies:
"@atproto/common-web" "^0.3.1"
"@atproto/syntax" "^0.3.1"
iso-datestring-validator "^2.2.2"
multiformats "^9.9.0"
zod "^3.23.8"
"@atproto/lexicon@^0.4.5":
version "0.4.5"
resolved "https://registry.yarnpkg.com/@atproto/lexicon/-/lexicon-0.4.5.tgz#4fcf3731193c674286e9e8d677bbab5dd530b817"
integrity sha512-fljWqMGKn+XWtTprBcS3F1hGBREnQYh6qYHv2sjENucc7REms1gtmZXSerB9N6pVeHVNOnXiILdukeAcic5OEw==
dependencies:
"@atproto/common-web" "^0.3.2"
"@atproto/syntax" "^0.3.1"
iso-datestring-validator "^2.2.2"
multiformats "^9.9.0"
zod "^3.23.8"
"@atproto/oauth-provider@^0.2.10": "@atproto/oauth-provider@^0.2.10":
version "0.2.10" version "0.2.10"
resolved "https://registry.yarnpkg.com/@atproto/oauth-provider/-/oauth-provider-0.2.10.tgz#f9820d7f82c33d3b74e81a75873f50e1e654b901" resolved "https://registry.yarnpkg.com/@atproto/oauth-provider/-/oauth-provider-0.2.10.tgz#f9820d7f82c33d3b74e81a75873f50e1e654b901"