@@ -4,6 +4,7 @@ import Commodities from "./commodities.svg";
44import CryptoIndex from "./crypto-index.svg" ;
55import CryptoRedemptionRate from "./crypto-redemption-rate.svg" ;
66import Crypto from "./crypto.svg" ;
7+ import Eco from "./eco.svg" ;
78import Equity from "./equity.svg" ;
89import Fx from "./fx.svg" ;
910import { icons } from "./icons" ;
@@ -19,19 +20,25 @@ type Props = Omit<SVGProps, keyof OwnProps | "width" | "height" | "viewBox"> &
1920 OwnProps ;
2021
2122export 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+ }
3542 }
3643} ;
3744
@@ -64,6 +71,7 @@ const ASSET_CLASS_TO_ICON = {
6471 "Crypto Index" : CryptoIndex ,
6572 "Crypto Redemption Rate" : CryptoRedemptionRate ,
6673 Crypto,
74+ ECO : Eco ,
6775 Equity,
6876 FX : Fx ,
6977 Metal,
0 commit comments