diff --git a/apps/marginfi-v2-ui/src/components/desktop/Points/PointsLeaderBoard.tsx b/apps/marginfi-v2-ui/src/components/desktop/Points/PointsLeaderBoard.tsx index c4b829ed2d..2a2725bc77 100644 --- a/apps/marginfi-v2-ui/src/components/desktop/Points/PointsLeaderBoard.tsx +++ b/apps/marginfi-v2-ui/src/components/desktop/Points/PointsLeaderBoard.tsx @@ -322,9 +322,13 @@ export const PointsLeaderBoard: FC = ({ currentUserId }) target="_blank" rel="noopener noreferrer" style={{ textDecoration: "none", color: "inherit" }} - className={clsx("hover:text-[#DCE85D]")} + className={clsx( + "hover:text-[#DCE85D] hover:opacity-100 transition", + data.domain && "font-bold", + !data.domain && "opacity-80" + )} > - {data.id} + {data.domain || data.shortAddress || data.id} ; total_activity_deposit_points: number; total_activity_borrow_points: number; @@ -76,40 +78,31 @@ async function fetchLeaderboardData({ const leaderboardFinalSliceWithDomains: LeaderboardRow[] = await Promise.all( leaderboardFinalSlice.map(async (value) => { + const newValue = { ...value, shortAddress: shortAddress(value.id) }; // attempt to get favorite domain try { const { reverse } = await getFavoriteDomain(connection, new PublicKey(value.id)); - if (reverse) { - return { - ...value, - id: `${reverse}.sol`, - }; - } + return { + ...newValue, + domain: `${reverse}.sol`, + }; } catch (e) { // attempt to get all domains try { const domains = await getAllDomains(connection, new PublicKey(value.id)); if (domains.length > 0) { const reverse = await reverseLookup(connection, domains[0]); - if (reverse) { - return { - ...value, - id: `${reverse}.sol`, - }; - } + return { + ...newValue, + domain: `${reverse}.sol`, + }; } } catch (e) { - return { - ...value, - id: shortAddress(value.id), - }; + return newValue; } } - return { - ...value, - id: shortAddress(value.id), - }; + return newValue; }) );