alternative tangled frontend (extremely wip)

feat: follow counts

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