From 2bb982ca9c9f297d490f53c4c3abbd0dd0c5bc21 Mon Sep 17 00:00:00 2001 From: Noah Prince Date: Wed, 24 Jul 2024 11:56:28 -0700 Subject: [PATCH] Purge yalc --- package.json | 24 ++-- scripts/resolve-proposals.ts | 1 + src/components/Proxies.tsx | 14 ++- yarn.lock | 221 +++++++++++------------------------ 4 files changed, 93 insertions(+), 167 deletions(-) diff --git a/package.json b/package.json index 77be43f..299b028 100644 --- a/package.json +++ b/package.json @@ -10,16 +10,16 @@ }, "dependencies": { "@coral-xyz/anchor": "^0.29.0", - "@helium/account-fetch-cache": "0.9.0-alpha.5", - "@helium/account-fetch-cache-hooks": "0.9.0-alpha.5", - "@helium/helium-react-hooks": "0.9.0-alpha.5", + "@helium/account-fetch-cache": "0.9.0-alpha.6", + "@helium/account-fetch-cache-hooks": "0.9.0-alpha.6", + "@helium/helium-react-hooks": "0.9.0-alpha.6", "@helium/modular-governance-hooks": "^0.0.8", "@helium/modular-governance-idls": "^0.0.8-next.22+7098baa", "@helium/organization-sdk": "^0.0.8", - "@helium/spl-utils": "0.9.0-alpha.5", + "@helium/spl-utils": "0.9.0-alpha.6", "@helium/state-controller-sdk": "^0.0.8", - "@helium/voter-stake-registry-hooks": "0.9.0-alpha.5", - "@helium/voter-stake-registry-sdk": "0.9.0-alpha.5", + "@helium/voter-stake-registry-hooks": "0.9.0-alpha.6", + "@helium/voter-stake-registry-sdk": "0.9.0-alpha.6", "@hookform/resolvers": "^3.3.4", "@metaplex-foundation/mpl-token-metadata": "2.10.0", "@project-serum/anchor": "^0.26.0", @@ -72,14 +72,14 @@ }, "resolutions": { "@solana/web3.js": "^1.90.0", - "@helium/account-fetch-cache": "^0.9.0-alpha.3", - "@helium/account-fetch-cache-hooks": "^0.9.0-alpha.3", - "@helium/helium-react-hooks": "^0.9.0-alpha.3", - "@helium/voter-stake-registry-hooks": "^0.9.0-alpha.3", - "@helium/spl-utils": "^0.9.0-alpha.3", + "@helium/account-fetch-cache": "^0.9.0-alpha.6", + "@helium/account-fetch-cache-hooks": "^0.9.0-alpha.6", + "@helium/helium-react-hooks": "^0.9.0-alpha.6", + "@helium/voter-stake-registry-hooks": "^0.9.0-alpha.6", + "@helium/spl-utils": "^0.9.0-alpha.6", "@helium/modular-governance-hooks": "^0.0.8", "@solana/wallet-adapter-react": "^0.15.35", - "@helium/voter-stake-registry-sdk": "^0.9.0-alpha.3" + "@helium/voter-stake-registry-sdk": "^0.9.0-alpha.6" }, "devDependencies": { "@tailwindcss/typography": "^0.5.10", diff --git a/scripts/resolve-proposals.ts b/scripts/resolve-proposals.ts index 4d5b35b..2e1724b 100644 --- a/scripts/resolve-proposals.ts +++ b/scripts/resolve-proposals.ts @@ -37,6 +37,7 @@ export async function run(args: any = process.argv) { connection: provider.connection, commitment: "confirmed", extendConnection: true, + enableLogging: true }); const orgProgram = await initOrg(provider); const stateProgram = await initState(provider); diff --git a/src/components/Proxies.tsx b/src/components/Proxies.tsx index 83a2395..e7ad587 100644 --- a/src/components/Proxies.tsx +++ b/src/components/Proxies.tsx @@ -9,7 +9,7 @@ import BN from "bn.js"; import { Loader2 } from "lucide-react"; import Link from "next/link"; import { usePathname } from "next/navigation"; -import { useState } from "react"; +import { useMemo, useState } from "react"; import { FaMagnifyingGlass, FaX } from "react-icons/fa6"; import { IoWarningOutline } from "react-icons/io5"; import InfiniteScroll from "react-infinite-scroll-component"; @@ -20,7 +20,7 @@ import { Input } from "./ui/input"; import { Skeleton } from "./ui/skeleton"; import { useDebounce } from "@uidotdev/usehooks"; -const DECENTRALIZATION_RISK_INDEX = 6; +const DECENTRALIZATION_RISK_PERCENT = 10; function CardDetail({ title, value }: { title: string; value: string }) { return ( @@ -85,6 +85,14 @@ export function Proxies() { ); const proxies = voters?.pages.flat() || []; + const renderBelowIndex = useMemo( + () => + proxies.findIndex( + (proxy) => Number(proxy.percent) < DECENTRALIZATION_RISK_PERCENT + ), + [proxies] + ); + return (
@@ -170,7 +178,7 @@ export function Proxies() { - {index == DECENTRALIZATION_RISK_INDEX ? ( + {renderBelowIndex > 0 && index === renderBelowIndex ? (