Skip to content

Commit

Permalink
Purge yalc
Browse files Browse the repository at this point in the history
  • Loading branch information
ChewingGlass committed Jul 24, 2024
1 parent 0d8e56f commit 2bb982c
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 167 deletions.
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions scripts/resolve-proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 11 additions & 3 deletions src/components/Proxies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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 (
Expand Down Expand Up @@ -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 (
<ContentSection className="flex-1 py-4">
<section className="flex flex-col flex-1 gap-4">
Expand Down Expand Up @@ -170,7 +178,7 @@ export function Proxies() {
</div>
</Card>
</Link>
{index == DECENTRALIZATION_RISK_INDEX ? (
{renderBelowIndex > 0 && index === renderBelowIndex ? (
<div className="py-2 px-4 text-sm w-full bg-accent/30 rounded-lg flex flex-row gap-2 items-center">
<IoWarningOutline
className="size-8"
Expand Down
Loading

0 comments on commit 2bb982c

Please sign in to comment.