Bluesky app fork with some witchin' additions 💫 witchsky.app
bluesky fork client

tweak wording for own badge (#4631)

authored by hailey.at and committed by

GitHub f94edc3f dd5198f3

+20 -4
+20 -4
src/components/NewskieDialog.tsx
··· 10 10 import {useModerationOpts} from '#/state/preferences/moderation-opts' 11 11 import {HITSLOP_10} from 'lib/constants' 12 12 import {sanitizeDisplayName} from 'lib/strings/display-names' 13 + import {useSession} from 'state/session' 13 14 import {atoms as a, useTheme} from '#/alf' 14 15 import {Button, ButtonText} from '#/components/Button' 15 16 import * as Dialog from '#/components/Dialog' ··· 28 29 const {_} = useLingui() 29 30 const t = useTheme() 30 31 const moderationOpts = useModerationOpts() 32 + const {currentAccount} = useSession() 33 + const timeAgo = useGetTimeAgo() 31 34 const control = useDialogControl() 35 + 36 + const isMe = profile.did === currentAccount?.did 37 + const createdAt = profile.createdAt as string | undefined 38 + 32 39 const profileName = React.useMemo(() => { 33 40 const name = profile.displayName || profile.handle 41 + 42 + if (isMe) { 43 + return _(msg`You`) 44 + } 45 + 34 46 if (!moderationOpts) return name 35 47 const moderation = moderateProfile(profile, moderationOpts) 48 + 36 49 return sanitizeDisplayName(name, moderation.ui('displayName')) 37 - }, [moderationOpts, profile]) 50 + }, [_, isMe, moderationOpts, profile]) 51 + 38 52 const [now] = React.useState(() => Date.now()) 39 - const timeAgo = useGetTimeAgo() 40 - const createdAt = profile.createdAt as string | undefined 41 53 const daysOld = React.useMemo(() => { 42 54 if (!createdAt) return Infinity 43 55 return differenceInSeconds(now, new Date(createdAt)) / 86400 ··· 87 99 /> 88 100 </View> 89 101 <Text style={[a.font_bold, a.text_xl]}> 90 - <Trans>Say hello!</Trans> 102 + {isMe ? ( 103 + <Trans>Welcome, friend!</Trans> 104 + ) : ( 105 + <Trans>Say hello!</Trans> 106 + )} 91 107 </Text> 92 108 </View> 93 109 <Text style={[a.text_md, a.text_center, a.leading_snug]}>