tangled
alpha
login
or
join now
isuggest.selfce.st
/
strand
3
fork
atom
alternative tangled frontend (extremely wip)
3
fork
atom
overview
issues
pulls
pipelines
feat: follow counts
serenity
1 week ago
572104a2
a7b863ad
+17
-4
1 changed file
expand all
collapse all
unified
split
src
components
Profile
ProfileOverview.tsx
+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
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
57
+
const {
58
58
+
isLoading: isFollowersLoading,
59
59
+
error: followersQueryErr,
60
60
+
data: followersQueryData,
61
61
+
} = useBacklinkCount({
62
62
+
subject: miniDocQueryData?.did ?? null,
63
63
+
source: "sh.tangled.graph.follow:subject",
64
64
+
});
56
65
57
66
const isLoading =
58
67
isMiniDocLoading ||
59
68
isAvatarLoading ||
60
69
isProfileLoading ||
61
70
isReposLoading ||
62
62
-
isFollowingLoading;
71
71
+
isFollowingLoading ||
72
72
+
isFollowersLoading;
63
73
const error =
64
74
miniDocQueryErr ??
65
75
avatarQueryErr ??
66
76
profileQueryErr ??
67
77
reposQueryErr ??
68
68
-
followingQueryErr;
78
78
+
followingQueryErr ??
79
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
78
-
!followingQueryData
89
89
+
!followingQueryData ||
90
90
+
!followersQueryData
79
91
)
80
92
return <Loading />;
81
93
···
131
143
className="text-subtext"
132
144
/>
133
145
<p>
134
134
-
100 <span className="text-subtext">followers</span>
146
146
+
{followersQueryData.total}{" "}
147
147
+
<span className="text-subtext">followers</span>
135
148
</p>
136
149
<LucideDot
137
150
height={12}