File tree Expand file tree Collapse file tree 6 files changed +30
-15
lines changed
components/OracleIntegrityStaking Expand file tree Collapse file tree 6 files changed +30
-15
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,7 @@ type Data = {
50
50
z : bigint ;
51
51
integrityStakingPublishers : {
52
52
identity :
53
- | {
54
- name : string ;
55
- icon : string ;
56
- }
53
+ | ( typeof KNOWN_PUBLISHERS ) [ keyof typeof KNOWN_PUBLISHERS ]
57
54
| undefined ;
58
55
publicKey : PublicKey ;
59
56
stakeAccount : PublicKey | undefined ;
@@ -271,7 +268,10 @@ const loadPublisherData = async (
271
268
return {
272
269
apyHistory,
273
270
identity : (
274
- KNOWN_PUBLISHERS as Record < string , { name : string ; icon : string } >
271
+ KNOWN_PUBLISHERS as Record <
272
+ string ,
273
+ ( typeof KNOWN_PUBLISHERS ) [ keyof typeof KNOWN_PUBLISHERS ]
274
+ >
275
275
) [ publisher . pubkey . toBase58 ( ) ] ,
276
276
numFeeds : numberOfSymbols ?? 0 ,
277
277
poolCapacity : getPublisherCap ( publisherCaps , publisher . pubkey ) ,
Original file line number Diff line number Diff line change @@ -10,17 +10,19 @@ import {
10
10
import { calculateApy } from "@pythnetwork/staking-sdk" ;
11
11
import { PublicKey } from "@solana/web3.js" ;
12
12
import clsx from "clsx" ;
13
- import Image from "next/image" ;
14
13
import {
15
14
useMemo ,
16
15
useCallback ,
17
16
useState ,
18
17
useRef ,
18
+ createElement ,
19
19
type ComponentProps ,
20
20
type Dispatch ,
21
21
type SetStateAction ,
22
22
type HTMLAttributes ,
23
23
type FormEvent ,
24
+ type ComponentType ,
25
+ type SVGProps ,
24
26
} from "react" ;
25
27
import { useFilter , useCollator } from "react-aria" ;
26
28
import {
@@ -1172,7 +1174,7 @@ type PublisherProps = {
1172
1174
identity :
1173
1175
| {
1174
1176
name : string ;
1175
- icon : string ;
1177
+ icon : ComponentType < SVGProps < SVGSVGElement > > ;
1176
1178
}
1177
1179
| undefined ;
1178
1180
publicKey : PublicKey ;
@@ -1721,13 +1723,9 @@ const PublisherIdentity = ({
1721
1723
props . children . identity ? (
1722
1724
< span className = { clsx ( className , withNameClassName ) } >
1723
1725
< span >
1724
- < Image
1725
- alt = { `${ props . children . identity . name } icon` }
1726
- src = { props . children . identity . icon }
1727
- className = "mr-2 inline-block size-[20px] align-sub"
1728
- width = { 20 }
1729
- height = { 20 }
1730
- />
1726
+ { createElement ( props . children . identity . icon , {
1727
+ className : "mr-2 inline-block size-[20px] align-sub" ,
1728
+ } ) }
1731
1729
< span className = "mr-[0.5em]" > { props . children . identity . name } </ span >
1732
1730
</ span >
1733
1731
< PublisherKey className = "text-sm opacity-50" { ...props } />
Original file line number Diff line number Diff line change
1
+ import blocksize from "./publisher-icons/blocksize.svg" ;
2
+ import sentio from "./publisher-icons/sentio.svg" ;
3
+
1
4
export const KNOWN_PUBLISHERS = {
2
5
CfVkYofcLC1iVBcYFzgdYPeiX25SVRmWvBQVHorP1A3y : {
3
6
name : "BLOCKSIZE" ,
4
- icon : "/publisher-icons/blocksize.png" ,
7
+ icon : blocksize ,
8
+ } ,
9
+ "89ijemG1TUL2kdV2RtCrhXzY5QhyKHsWqCmP5iobvLUF" : {
10
+ name : "Sentio" ,
11
+ icon : sentio ,
5
12
} ,
6
13
} ;
You can’t perform that action at this time.
0 commit comments