ai/at
1
0

fix social-app web support link

This commit is contained in:
2026-02-16 05:36:31 +09:00
parent 0506a32fd8
commit 19299233fc
4 changed files with 39 additions and 27 deletions

View File

@@ -1,5 +1,5 @@
--- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx 2026-02-16 03:00:07
+++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx 2026-02-16 03:02:25
--- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx
+++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx
@@ -1,5 +1,5 @@
import {memo, useMemo, useState} from 'react'
-import {View} from 'react-native'
@@ -7,28 +7,20 @@
import {
type AppBskyActorDefs,
moderateProfile,
@@ -9,9 +9,11 @@
@@ -9,9 +9,12 @@
} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
+import {useQuery} from '@tanstack/react-query'
import {useActorStatus} from '#/lib/actor-status'
+import {BSKY_SERVICE} from '#/lib/constants'
import {useHaptics} from '#/lib/haptics'
+import {useOpenLink} from '#/lib/hooks/useOpenLink'
import {sanitizeDisplayName} from '#/lib/strings/display-names'
import {sanitizeHandle} from '#/lib/strings/handles'
import {logger} from '#/logger'
@@ -20,7 +22,7 @@
useProfileBlockMutationQueue,
useProfileFollowMutationQueue,
} from '#/state/queries/profile'
-import {useRequireAuth, useSession} from '#/state/session'
+import {useAgent, useRequireAuth, useSession} from '#/state/session'
import {ProfileMenu} from '#/view/com/profile/ProfileMenu'
import {atoms as a, platform, useBreakpoints, useTheme} from '#/alf'
import {SubscribeProfileButton} from '#/components/activity-notifications/SubscribeProfileButton'
@@ -45,6 +47,83 @@
@@ -45,6 +48,84 @@
import {ProfileHeaderMetrics} from './Metrics'
import {ProfileHeaderShell} from './Shell'
import {ProfileHeaderSuggestedFollows} from './SuggestedFollows'
@@ -45,16 +37,17 @@
+ profile: AppBskyActorDefs.ProfileViewDetailed
+}) {
+ const t = useTheme()
+ const agent = useAgent()
+ const openLink = useOpenLink()
+
+ const {data: services} = useQuery({
+ queryKey: ['profile-services', profile.did],
+ queryFn: async () => {
+ const res = await agent.com.atproto.repo.describeRepo({
+ repo: profile.did,
+ })
+ const collections: string[] = res.data.collections || []
+ const res = await fetch(
+ `${BSKY_SERVICE}/xrpc/com.atproto.repo.describeRepo?repo=${encodeURIComponent(profile.did)}`,
+ )
+ if (!res.ok) throw new Error('failed')
+ const data = await res.json()
+ const collections: string[] = data.collections || []
+ const serviceSet = new Set<string>()
+ for (const nsid of collections) {
+ const parts = nsid.split('.')
@@ -112,7 +105,7 @@
interface Props {
profile: AppBskyActorDefs.ProfileViewDetailed
@@ -151,6 +230,7 @@
@@ -151,6 +232,7 @@
{!isPlaceholderProfile && !isBlockedUser && (
<View style={a.gap_md}>
<ProfileHeaderMetrics profile={profile} />

View File

@@ -0,0 +1,19 @@
--- a/src/view/shell/desktop/RightNav.tsx
+++ b/src/view/shell/desktop/RightNav.tsx
@@ -111,14 +111,14 @@
</>
)}
<InlineLinkText
- to="https://bsky.social/about/support/privacy-policy"
+ to="/support/privacy-policy"
style={[t.atoms.text_contrast_medium]}
label={_(msg`Privacy`)}>
{_(msg`Privacy`)}
</InlineLinkText>
<Text style={[t.atoms.text_contrast_low]}>{' ∙ '}</Text>
<InlineLinkText
- to="https://bsky.social/about/support/tos"
+ to="/support/tos"
style={[t.atoms.text_contrast_medium]}
label={_(msg`Terms`)}>
{_(msg`Terms`)}

View File

@@ -3,8 +3,8 @@ import {Pressable, View} from 'react-native'
import {type AppBskyActorDefs} from '@atproto/api'
import {useQuery} from '@tanstack/react-query'
import {BSKY_SERVICE} from '#/lib/constants'
import {useOpenLink} from '#/lib/hooks/useOpenLink'
import {useAgent} from '#/state/session'
import {atoms as a, useTheme} from '#/alf'
import {Text} from '#/components/Typography'
import {createSinglePathSVG} from '#/components/icons/TEMPLATE'
@@ -74,18 +74,17 @@ export function ProfileAtLinks({
profile: AppBskyActorDefs.ProfileViewDetailed
}) {
const t = useTheme()
const agent = useAgent()
const openLink = useOpenLink()
const {data: linkData} = useQuery({
queryKey: ['at-links', profile.did],
queryFn: async () => {
const res = await agent.com.atproto.repo.getRecord({
repo: profile.did,
collection: 'ai.syui.at.link',
rkey: 'self',
})
return res.data.value as LinkCollection
const res = await fetch(
`${BSKY_SERVICE}/xrpc/com.atproto.repo.getRecord?repo=${encodeURIComponent(profile.did)}&collection=ai.syui.at.link&rkey=self`,
)
if (!res.ok) throw new Error('not found')
const json = await res.json()
return json.value as LinkCollection
},
retry: false,
staleTime: 1000 * 60 * 5,