From 9749883cc177ef82c66a78bc50c9f00b9046d7b1 Mon Sep 17 00:00:00 2001 From: Martti Malmi Date: Tue, 28 Nov 2023 14:46:18 +0200 Subject: [PATCH] checkmark hover text --- .../Element/User/FollowDistanceIndicator.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/app/src/Element/User/FollowDistanceIndicator.tsx b/packages/app/src/Element/User/FollowDistanceIndicator.tsx index 4e6197b3..2016f6ef 100644 --- a/packages/app/src/Element/User/FollowDistanceIndicator.tsx +++ b/packages/app/src/Element/User/FollowDistanceIndicator.tsx @@ -11,17 +11,26 @@ interface FollowDistanceIndicatorProps { export default function FollowDistanceIndicator({ pubkey, className }: FollowDistanceIndicatorProps) { const followDistance = socialGraphInstance.getFollowDistance(pubkey); let followDistanceColor = ""; + let title = ""; - if (followDistance <= 1) { + if (followDistance === 0) { + title = "You"; followDistanceColor = "success"; - } else if (followDistance === 2 && socialGraphInstance.followedByFriendsCount(pubkey) >= 10) { - followDistanceColor = "text-nostr-orange"; + } else if (followDistance <= 1) { + followDistanceColor = "success"; + title = "Following"; + } else if (followDistance === 2) { + const followedByFriendsCount = socialGraphInstance.followedByFriendsCount(pubkey); + if (followedByFriendsCount > 10) { + followDistanceColor = "text-nostr-orange"; + } + title = `Followed by ${followedByFriendsCount} friends`; } else if (followDistance > 2) { return null; } return ( - + );