tangled
alpha
login
or
join now
whey.party
/
red-dwarf
82
fork
atom
an independent Bluesky client using Constellation, PDS Queries, and other services
reddwarf.app
frontend
spa
bluesky
reddwarf
microcosm
client
app
82
fork
atom
overview
issues
25
pulls
pipelines
actual mutuals indicator
rimar1337
4 months ago
b3faaa61
37d24d0e
+19
-5
1 changed file
expand all
collapse all
unified
split
src
routes
profile.$did
index.tsx
+19
-5
src/routes/profile.$did/index.tsx
···
286
286
const {agent} = useAuth()
287
287
const {data: identity} = useQueryIdentity(targetdidorhandle);
288
288
289
289
-
const mutualfollows = useGetOneToOneState(agent?.did ? {
289
289
+
const theyFollowYouRes = useGetOneToOneState(agent?.did ? {
290
290
target: agent?.did,
291
291
user: identity?.did ?? targetdidorhandle,
292
292
collection: "app.bsky.graph.follow",
293
293
path: ".subject"
294
294
}:undefined);
295
295
296
296
-
const ismutual: boolean = (!!mutualfollows?.length && mutualfollows.length > 0)
296
296
+
const youFollowThemRes = useGetFollowState({
297
297
+
target: identity?.did ?? targetdidorhandle,
298
298
+
user: agent?.did,
299
299
+
});
300
300
+
301
301
+
const theyFollowYou: boolean = (!!theyFollowYouRes?.length && theyFollowYouRes.length > 0)
302
302
+
const youFollowThem: boolean = (!!youFollowThemRes?.length && youFollowThemRes.length > 0)
297
303
298
304
return (
299
305
<>
306
306
+
{/* if not self */}
300
307
{identity?.did !== agent?.did ? (
301
308
<>
302
302
-
{!(ismutual) ? (
303
303
-
<></>
309
309
+
{(theyFollowYou) ? (
310
310
+
<>
311
311
+
{youFollowThem ? (
312
312
+
<div className=" text-sm px-1.5 py-0.5 text-gray-500 bg-gray-200 dark:text-gray-400 dark:bg-gray-800 rounded-lg flex flex-row items-center justify-center">mutuals</div>
313
313
+
) : (
314
314
+
<div className=" text-sm px-1.5 py-0.5 text-gray-500 bg-gray-200 dark:text-gray-400 dark:bg-gray-800 rounded-lg flex flex-row items-center justify-center">follows you</div>
315
315
+
)
316
316
+
}
317
317
+
</>
304
318
) : (
305
305
-
<div className=" text-sm px-1.5 py-0.5 text-gray-500 bg-gray-200 dark:text-gray-400 dark:bg-gray-800 rounded-lg flex flex-row items-center justify-center">mutuals</div>
319
319
+
<></>
306
320
)}
307
321
</>
308
322
) : (