alternative tangled frontend (extremely wip)

feat: follow counts

+17 -4
+17 -4
src/components/Profile/ProfileOverview.tsx
··· 4 import { Avatar } from "@/components/Profile/Avatar"; 5 import { PinnedRepos } from "@/components/Profile/PinnedRepos"; 6 import { DEFAULT_BSKY_CLIENT_URL } from "@/lib/consts"; 7 import { useAvatarQuery } from "@/lib/queries/get-avatar"; 8 import { useFollowingQuery } from "@/lib/queries/get-following"; 9 import { useProfileQuery } from "@/lib/queries/get-profile"; ··· 53 did: miniDocQueryData?.did ?? null, 54 repoUrl: miniDocQueryData ? new URL(miniDocQueryData.pds) : null, 55 }); 56 57 const isLoading = 58 isMiniDocLoading || 59 isAvatarLoading || 60 isProfileLoading || 61 isReposLoading || 62 - isFollowingLoading; 63 const error = 64 miniDocQueryErr ?? 65 avatarQueryErr ?? 66 profileQueryErr ?? 67 reposQueryErr ?? 68 - followingQueryErr; 69 70 if (error && !isLoading) return <p>{error.message}</p>; 71 ··· 75 !avatarQueryData || 76 !profileQueryData || 77 !reposQueryData || 78 - !followingQueryData 79 ) 80 return <Loading />; 81 ··· 131 className="text-subtext" 132 /> 133 <p> 134 - 100 <span className="text-subtext">followers</span> 135 </p> 136 <LucideDot 137 height={12}
··· 4 import { Avatar } from "@/components/Profile/Avatar"; 5 import { PinnedRepos } from "@/components/Profile/PinnedRepos"; 6 import { DEFAULT_BSKY_CLIENT_URL } from "@/lib/consts"; 7 + import { useBacklinkCount } from "@/lib/queries/constellation-backlink-count"; 8 import { useAvatarQuery } from "@/lib/queries/get-avatar"; 9 import { useFollowingQuery } from "@/lib/queries/get-following"; 10 import { useProfileQuery } from "@/lib/queries/get-profile"; ··· 54 did: miniDocQueryData?.did ?? null, 55 repoUrl: miniDocQueryData ? new URL(miniDocQueryData.pds) : null, 56 }); 57 + const { 58 + isLoading: isFollowersLoading, 59 + error: followersQueryErr, 60 + data: followersQueryData, 61 + } = useBacklinkCount({ 62 + subject: miniDocQueryData?.did ?? null, 63 + source: "sh.tangled.graph.follow:subject", 64 + }); 65 66 const isLoading = 67 isMiniDocLoading || 68 isAvatarLoading || 69 isProfileLoading || 70 isReposLoading || 71 + isFollowingLoading || 72 + isFollowersLoading; 73 const error = 74 miniDocQueryErr ?? 75 avatarQueryErr ?? 76 profileQueryErr ?? 77 reposQueryErr ?? 78 + followingQueryErr ?? 79 + followersQueryErr; 80 81 if (error && !isLoading) return <p>{error.message}</p>; 82 ··· 86 !avatarQueryData || 87 !profileQueryData || 88 !reposQueryData || 89 + !followingQueryData || 90 + !followersQueryData 91 ) 92 return <Loading />; 93 ··· 143 className="text-subtext" 144 /> 145 <p> 146 + {followersQueryData.total}{" "} 147 + <span className="text-subtext">followers</span> 148 </p> 149 <LucideDot 150 height={12}