tangled
alpha
login
or
join now
jollywhoppers.com
/
witchsky.app
103
fork
atom
Bluesky app fork with some witchin' additions 💫
witchsky.app
bluesky
fork
client
103
fork
atom
overview
issues
44
pulls
pipelines
feat: add exact join date tooltip to profiles
xan.lol
11 hours ago
e93bc65e
d7d6eacf
verified
This commit was signed with the committer's
known signature
.
xan.lol
SSH Key Fingerprint:
SHA256:7Zs+dcly5YqxBg7v8XsE1uPMYCobHKBw7CDiNxpmSrY=
+30
-5
1 changed file
expand all
collapse all
unified
split
src
screens
Profile
Header
ProfileHeaderStandard.tsx
+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
17
-
import {formatJoinDate} from '#/lib/strings/time'
17
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
31
-
import {atoms as a, platform, tokens, useBreakpoints, useTheme} from '#/alf'
31
31
+
import {
32
32
+
atoms as a,
33
33
+
native,
34
34
+
platform,
35
35
+
tokens,
36
36
+
useBreakpoints,
37
37
+
useTheme,
38
38
+
web,
39
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
80
-
const {_} = useLingui()
88
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
109
+
const dateJoinedExact = useMemo(() => {
110
110
+
if (!profile.createdAt) return ''
111
111
+
112
112
+
const createdAt = new Date(profile.createdAt)
113
113
+
if (Number.isNaN(createdAt.getTime())) return ''
114
114
+
115
115
+
return niceDate(i18n, createdAt)
116
116
+
}, [i18n, profile.createdAt])
117
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
128
-
style={[a.px_lg, a.pt_md, a.pb_sm, a.overflow_hidden]}
145
145
+
style={[
146
146
+
a.px_lg,
147
147
+
a.pt_md,
148
148
+
a.pb_sm,
149
149
+
native(a.overflow_hidden),
150
150
+
web({overflowX: 'clip', zIndex: 10}),
151
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
236
-
<Text style={[t.atoms.text_contrast_medium]}>
259
259
+
<Text
260
260
+
style={[t.atoms.text_contrast_medium]}
261
261
+
title={dateJoinedExact}>
237
262
<Trans>Joined {dateJoined}</Trans>
238
263
</Text>
239
264
</View>