From 1de44ecdf0c693bc6c5f766ac90e4116657e3e23 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 7 Jan 2025 10:59:01 -0600 Subject: [PATCH] Add AnyCoreProfileView, need to discuss --- src/types/atproto/profile.ts | 8 ++++++++ src/view/com/profile/ProfileCard.tsx | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/types/atproto/profile.ts b/src/types/atproto/profile.ts index 55881fe126..2701f8991e 100644 --- a/src/types/atproto/profile.ts +++ b/src/types/atproto/profile.ts @@ -27,6 +27,14 @@ export type AnyProfileView = | AppBskyActorDefs.ProfileViewDetailed | ChatBskyActorDefs.ProfileViewBasic +/** + * Matches `app.bsky.*` profile view exported by our SDK + */ +export type AnyCoreProfileView = + | AppBskyActorDefs.ProfileViewBasic + | AppBskyActorDefs.ProfileView + | AppBskyActorDefs.ProfileViewDetailed + /** * Maps any profile view type to `ProfileViewBasic`. */ diff --git a/src/view/com/profile/ProfileCard.tsx b/src/view/com/profile/ProfileCard.tsx index 8a258498fb..b8523ba87d 100644 --- a/src/view/com/profile/ProfileCard.tsx +++ b/src/view/com/profile/ProfileCard.tsx @@ -42,12 +42,12 @@ export function ProfileCard({ showKnownFollowers, }: { testID?: string - profile: atp.profile.AnyProfileView + profile: atp.profile.AnyCoreProfileView noModFilter?: boolean noBg?: boolean noBorder?: boolean renderButton?: ( - profile: Shadow, + profile: Shadow, ) => React.ReactNode onPress?: () => void style?: StyleProp