diff --git a/apps/staking/public/publisher-icons/blocksize.png b/apps/staking/public/publisher-icons/blocksize.png deleted file mode 100644 index f93928d89e..0000000000 Binary files a/apps/staking/public/publisher-icons/blocksize.png and /dev/null differ diff --git a/apps/staking/src/api.ts b/apps/staking/src/api.ts index 9759488b20..6e6e24e72c 100644 --- a/apps/staking/src/api.ts +++ b/apps/staking/src/api.ts @@ -50,10 +50,7 @@ type Data = { z: bigint; integrityStakingPublishers: { identity: - | { - name: string; - icon: string; - } + | (typeof KNOWN_PUBLISHERS)[keyof typeof KNOWN_PUBLISHERS] | undefined; publicKey: PublicKey; stakeAccount: PublicKey | undefined; @@ -271,7 +268,10 @@ const loadPublisherData = async ( return { apyHistory, identity: ( - KNOWN_PUBLISHERS as Record + KNOWN_PUBLISHERS as Record< + string, + (typeof KNOWN_PUBLISHERS)[keyof typeof KNOWN_PUBLISHERS] + > )[publisher.pubkey.toBase58()], numFeeds: numberOfSymbols ?? 0, poolCapacity: getPublisherCap(publisherCaps, publisher.pubkey), diff --git a/apps/staking/src/components/OracleIntegrityStaking/index.tsx b/apps/staking/src/components/OracleIntegrityStaking/index.tsx index a4b8e68dbf..d00bd06ef1 100644 --- a/apps/staking/src/components/OracleIntegrityStaking/index.tsx +++ b/apps/staking/src/components/OracleIntegrityStaking/index.tsx @@ -10,17 +10,19 @@ import { import { calculateApy } from "@pythnetwork/staking-sdk"; import { PublicKey } from "@solana/web3.js"; import clsx from "clsx"; -import Image from "next/image"; import { useMemo, useCallback, useState, useRef, + createElement, type ComponentProps, type Dispatch, type SetStateAction, type HTMLAttributes, type FormEvent, + type ComponentType, + type SVGProps, } from "react"; import { useFilter, useCollator } from "react-aria"; import { @@ -1172,7 +1174,7 @@ type PublisherProps = { identity: | { name: string; - icon: string; + icon: ComponentType>; } | undefined; publicKey: PublicKey; @@ -1721,13 +1723,9 @@ const PublisherIdentity = ({ props.children.identity ? ( - {`${props.children.identity.name} + {createElement(props.children.identity.icon, { + className: "mr-2 inline-block size-[20px] align-sub", + })} {props.children.identity.name} diff --git a/apps/staking/src/known-publishers.ts b/apps/staking/src/known-publishers.ts index 2aa096d8da..af111678e9 100644 --- a/apps/staking/src/known-publishers.ts +++ b/apps/staking/src/known-publishers.ts @@ -1,6 +1,13 @@ +import blocksize from "./publisher-icons/blocksize.svg"; +import sentio from "./publisher-icons/sentio.svg"; + export const KNOWN_PUBLISHERS = { CfVkYofcLC1iVBcYFzgdYPeiX25SVRmWvBQVHorP1A3y: { name: "BLOCKSIZE", - icon: "/publisher-icons/blocksize.png", + icon: blocksize, + }, + "89ijemG1TUL2kdV2RtCrhXzY5QhyKHsWqCmP5iobvLUF": { + name: "Sentio", + icon: sentio, }, }; diff --git a/apps/staking/src/publisher-icons/blocksize.svg b/apps/staking/src/publisher-icons/blocksize.svg new file mode 100644 index 0000000000..1fd16271e3 --- /dev/null +++ b/apps/staking/src/publisher-icons/blocksize.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/apps/staking/src/publisher-icons/sentio.svg b/apps/staking/src/publisher-icons/sentio.svg new file mode 100644 index 0000000000..f51a0af303 --- /dev/null +++ b/apps/staking/src/publisher-icons/sentio.svg @@ -0,0 +1,4 @@ + + + +