Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Generate separate strings for join messages in Newskie dialog (#8007)

* try again

* prettier

* prettier round 2

* Update src/components/NewskieDialog.tsx

Co-authored-by: Samuel Newman <mozzius@protonmail.com>

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>

authored by

surfdude29
Samuel Newman
and committed by
GitHub
b9a41f30 6a4c56df

+27 -19
+27 -19
src/components/NewskieDialog.tsx
··· 85 85 const isMe = profile.did === currentAccount?.did 86 86 87 87 const profileName = useMemo(() => { 88 - const name = profile.displayName || profile.handle 88 + if (!moderationOpts) return profile.displayName || profile.handle 89 + const moderation = moderateProfile(profile, moderationOpts) 90 + return sanitizeDisplayName( 91 + profile.displayName || profile.handle, 92 + moderation.ui('displayName'), 93 + ) 94 + }, [moderationOpts, profile]) 95 + 96 + const getJoinMessage = () => { 97 + const timeAgoString = timeAgo(createdAt, now, {format: 'long'}) 89 98 90 99 if (isMe) { 91 - return _(msg`You`) 100 + if (profile.joinedViaStarterPack) { 101 + return _( 102 + msg`You joined Bluesky using a starter pack ${timeAgoString} ago`, 103 + ) 104 + } else { 105 + return _(msg`You joined Bluesky ${timeAgoString} ago`) 106 + } 107 + } else { 108 + if (profile.joinedViaStarterPack) { 109 + return _( 110 + msg`${profileName} joined Bluesky using a starter pack ${timeAgoString} ago`, 111 + ) 112 + } else { 113 + return _(msg`${profileName} joined Bluesky ${timeAgoString} ago`) 114 + } 92 115 } 93 - 94 - if (!moderationOpts) return name 95 - const moderation = moderateProfile(profile, moderationOpts) 96 - 97 - return sanitizeDisplayName(name, moderation.ui('displayName')) 98 - }, [_, isMe, moderationOpts, profile]) 116 + } 99 117 100 118 return ( 101 119 <Dialog.ScrollableInner ··· 122 140 </Text> 123 141 </View> 124 142 <Text style={[a.text_md, a.text_center, a.leading_snug]}> 125 - {profile.joinedViaStarterPack ? ( 126 - <Trans> 127 - {profileName} joined Bluesky using a starter pack{' '} 128 - {timeAgo(createdAt, now, {format: 'long'})} ago 129 - </Trans> 130 - ) : ( 131 - <Trans> 132 - {profileName} joined Bluesky{' '} 133 - {timeAgo(createdAt, now, {format: 'long'})} ago 134 - </Trans> 135 - )} 143 + {getJoinMessage()} 136 144 </Text> 137 145 {profile.joinedViaStarterPack ? ( 138 146 <StarterPackCard.Link