From 070363c947600c48368b01c776ea34fbf422f81e Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 12 Jun 2024 11:39:41 -0700 Subject: [PATCH] tweaks --- src/components/StarterPack/NewskieDialog.tsx | 32 +++++++++++++------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/components/StarterPack/NewskieDialog.tsx b/src/components/StarterPack/NewskieDialog.tsx index b1b9e09854..a8b873af72 100644 --- a/src/components/StarterPack/NewskieDialog.tsx +++ b/src/components/StarterPack/NewskieDialog.tsx @@ -21,11 +21,12 @@ export function NewskieDialog({ profile: AppBskyActorDefs.ProfileViewDetailed }) { const {_} = useLingui() - const control = useDialogControl() - - const profileName = profile.displayName || `@${profile.handle}` - const joinedVia = profile.joinedViaStarterPack const {currentAccount} = useSession() + const control = useDialogControl() + const {joinedViaStarterPack} = profile + const profileName = profile.displayName || `@${profile.handle}` + + if (!profile.createdAt) return null return ( <> @@ -48,22 +49,31 @@ export function NewskieDialog({ Say hello! - {AppBskyGraphStarterpack.isRecord(joinedVia?.record) && - profile.createdAt ? ( + {AppBskyGraphStarterpack.isRecord( + joinedViaStarterPack?.record, + ) ? ( {profileName} joined Bluesky {ago(profile.createdAt, true)}{' '} ago with{' '} - {joinedVia?.creator.did === currentAccount?.did + {joinedViaStarterPack?.creator.did === currentAccount?.did ? 'your' - : `${joinedVia?.creator.displayName}'s` || - `@${joinedVia?.creator.handle}'s`}{' '} + : `${joinedViaStarterPack?.creator.displayName}'s` || + `@${joinedViaStarterPack?.creator.handle}'s`}{' '} starter pack. ) : ( - {profileName} recently joined Bluesky 3 days ago + + {profileName} recently joined Bluesky {ago(profile.createdAt)}{' '} + ago + )} - + {joinedViaStarterPack && ( + + )}