@@ -4,6 +4,7 @@ import Commodities from "./commodities.svg";
4
4
import CryptoIndex from "./crypto-index.svg" ;
5
5
import CryptoRedemptionRate from "./crypto-redemption-rate.svg" ;
6
6
import Crypto from "./crypto.svg" ;
7
+ import Eco from "./eco.svg" ;
7
8
import Equity from "./equity.svg" ;
8
9
import Fx from "./fx.svg" ;
9
10
import { icons } from "./icons" ;
@@ -19,19 +20,25 @@ type Props = Omit<SVGProps, keyof OwnProps | "width" | "height" | "viewBox"> &
19
20
OwnProps ;
20
21
21
22
export const PriceFeedIcon = ( { assetClass, symbol, ...props } : Props ) => {
22
- if ( assetClass === "Crypto" ) {
23
- const firstPart = symbol . split ( "." ) [ 1 ] ?. split ( "/" ) [ 0 ] ;
24
- const Icon = firstPart ? ( icons as SVGRecord ) [ firstPart ] : undefined ;
25
- return Icon ? (
26
- < Icon width = "100%" height = "100%" viewBox = "0 0 32 32" { ...props } />
27
- ) : (
28
- < GenericIcon assetClass = "Crypto" { ...props } />
29
- ) ;
30
- } else {
31
- return assetClassHasIcon ( assetClass ) ? (
32
- < GenericIcon assetClass = { assetClass } { ...props } />
33
- ) : // eslint-disable-next-line unicorn/no-null
34
- null ;
23
+ switch ( assetClass ) {
24
+ case "Crypto" : {
25
+ const firstPart = symbol . split ( "." ) [ 1 ] ?. split ( "/" ) [ 0 ] ;
26
+ const Icon = firstPart ? ( icons as SVGRecord ) [ firstPart ] : undefined ;
27
+ return Icon ? (
28
+ < Icon width = "100%" height = "100%" viewBox = "0 0 32 32" { ...props } />
29
+ ) : (
30
+ < GenericIcon assetClass = "Crypto" { ...props } />
31
+ ) ;
32
+ }
33
+ case "Crypto NAV" : {
34
+ return < GenericIcon assetClass = "Crypto" { ...props } /> ;
35
+ }
36
+ default : {
37
+ return assetClassHasIcon ( assetClass ) ? (
38
+ < GenericIcon assetClass = { assetClass } { ...props } />
39
+ ) : // eslint-disable-next-line unicorn/no-null
40
+ null ;
41
+ }
35
42
}
36
43
} ;
37
44
@@ -64,6 +71,7 @@ const ASSET_CLASS_TO_ICON = {
64
71
"Crypto Index" : CryptoIndex ,
65
72
"Crypto Redemption Rate" : CryptoRedemptionRate ,
66
73
Crypto,
74
+ ECO : Eco ,
67
75
Equity,
68
76
FX : Fx ,
69
77
Metal,
0 commit comments