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

feat: add exact join date tooltip to profiles

xan.lol e93bc65e d7d6eacf

verified
+30 -5
+30 -5
src/screens/Profile/Header/ProfileHeaderStandard.tsx
··· 14 14 import {useHaptics} from '#/lib/haptics' 15 15 import {sanitizeDisplayName} from '#/lib/strings/display-names' 16 16 import {sanitizeHandle} from '#/lib/strings/handles' 17 - import {formatJoinDate} from '#/lib/strings/time' 17 + import {formatJoinDate, niceDate} from '#/lib/strings/time' 18 18 import { 19 19 sanitizeWebsiteForDisplay, 20 20 sanitizeWebsiteForLink, ··· 28 28 } from '#/state/queries/profile' 29 29 import {useRequireAuth, useSession} from '#/state/session' 30 30 import {ProfileMenu} from '#/view/com/profile/ProfileMenu' 31 - import {atoms as a, platform, tokens, useBreakpoints, useTheme} from '#/alf' 31 + import { 32 + atoms as a, 33 + native, 34 + platform, 35 + tokens, 36 + useBreakpoints, 37 + useTheme, 38 + web, 39 + } from '#/alf' 32 40 import {SubscribeProfileButton} from '#/components/activity-notifications/SubscribeProfileButton' 33 41 import {Button, ButtonIcon, ButtonText} from '#/components/Button' 34 42 import {DebugFieldDisplay} from '#/components/DebugFieldDisplay' ··· 77 85 const profile = 78 86 useProfileShadow<AppBskyActorDefs.ProfileViewDetailed>(profileUnshadowed) 79 87 const {currentAccount} = useSession() 80 - const {_} = useLingui() 88 + const {_, i18n} = useLingui() 81 89 const moderation = useMemo( 82 90 () => moderateProfile(profile, moderationOpts), 83 91 [profile, moderationOpts], ··· 98 106 return formatJoinDate(profile.createdAt) 99 107 }, [profile.createdAt]) 100 108 109 + const dateJoinedExact = useMemo(() => { 110 + if (!profile.createdAt) return '' 111 + 112 + const createdAt = new Date(profile.createdAt) 113 + if (Number.isNaN(createdAt.getTime())) return '' 114 + 115 + return niceDate(i18n, createdAt) 116 + }, [i18n, profile.createdAt]) 117 + 101 118 const unblockAccount = async () => { 102 119 try { 103 120 await queueUnblock() ··· 125 142 hideBackButton={hideBackButton} 126 143 isPlaceholderProfile={isPlaceholderProfile}> 127 144 <View 128 - style={[a.px_lg, a.pt_md, a.pb_sm, a.overflow_hidden]} 145 + style={[ 146 + a.px_lg, 147 + a.pt_md, 148 + a.pb_sm, 149 + native(a.overflow_hidden), 150 + web({overflowX: 'clip', zIndex: 10}), 151 + ]} 129 152 pointerEvents={IS_IOS ? 'auto' : 'box-none'}> 130 153 <View 131 154 style={[ ··· 233 256 width={tokens.space.lg} 234 257 style={{color: t.atoms.text_contrast_medium.color}} 235 258 /> 236 - <Text style={[t.atoms.text_contrast_medium]}> 259 + <Text 260 + style={[t.atoms.text_contrast_medium]} 261 + title={dateJoinedExact}> 237 262 <Trans>Joined {dateJoined}</Trans> 238 263 </Text> 239 264 </View>