From 3900cdd0dc78ccdc8a9ab0429f2643707f41e4fc Mon Sep 17 00:00:00 2001 From: Jack Short Date: Fri, 21 Apr 2023 11:56:13 -0400 Subject: [PATCH] chore: removing fallback rarity provider (#6408) --- public/nft/logos/poprank.png | Bin 1255 -> 0 bytes src/nft/components/collection/ActivityCells.tsx | 9 ++------- src/nft/components/details/AssetDetails.tsx | 8 ++------ src/nft/utils/index.ts | 1 - src/nft/utils/rarity.ts | 16 ---------------- 5 files changed, 4 insertions(+), 30 deletions(-) delete mode 100644 public/nft/logos/poprank.png delete mode 100644 src/nft/utils/rarity.ts diff --git a/public/nft/logos/poprank.png b/public/nft/logos/poprank.png deleted file mode 100644 index 78214c3f45c785329b2cf720e5b0bebe21a93d36..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1255 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstU$g(vPY0F z14ES>14Ba#1H&(%P{RubhEf9thF1v;3|2E37{m+a>e)cfWpLmUKDSqoi$Vr6*R_KOupcf9Jnz zkxxH=d6<9i{l{a%3BNnO^nR5|e1Ac?SB}YX%iE+Y&n~52e)fEq2#+3T(c~#r%2iX6 zl~c1aO}_v8(D>os)!vP)cV_Nj>-jQc-I1dkyf+-37Ixssu`)&uJ}yQsK6WM^K3|$YC$>^mS!_$|K6cAa;9u`39iSb59q?5Q)pl2|yqsC@L(R zo|M+WD8}ijnJF0=wu52zoIihla&^7QVDgeVrL}5~fNs_+saa9CVyt#m{kp@$*5-Ch zZCTngv1wt~xN~yeO1zPknL8&o=I$L^o4sN>8$PB*>?l~+zh3?V&;N!4tlUja2bmNV z8ZT`4&~ZXTt}WyDj2kaKI5_WIO6%)I*FFj}0yqR<7&YnL_hZZH(F}6**bZOJ4 zu2VlluXc;+uUjeFA{`aZFOrcV!o+Q2%FG&dfT@XRZSGsyxv_WO+3v0VE3D=xlrqC6 z_0*Nj%jsukSZ05lv-5L{B*XI;0iB=9>mz|)RxNRjC`m~yNwrEYN(E93Mg~TPx`sx& zMus53oE!Zm>f=F vR^A+ { - const source = (rarity as TokenRarity).source || (rarity as Rarity).primaryProvider const rank = (rarity as TokenRarity).rank || (rarity as Rarity).providers?.[0].rank - const rarityProviderLogo = getRarityProviderLogo(source) if (!rank) return null @@ -351,12 +348,10 @@ const Ranking = ({ rarity, collectionName, rarityVerified }: RankingProps) => { text={ - cardLogo + cardLogo - {rarityVerified - ? `Verified by ${collectionName}` - : `Ranking by ${source === 'Genie' ? fallbackProvider : source}`} + {rarityVerified ? `Verified by ${collectionName}` : `Ranking by Rarity Sniper`} } diff --git a/src/nft/components/details/AssetDetails.tsx b/src/nft/components/details/AssetDetails.tsx index f544d171a9..ead0af0c55 100644 --- a/src/nft/components/details/AssetDetails.tsx +++ b/src/nft/components/details/AssetDetails.tsx @@ -17,7 +17,6 @@ import { formatEth, formatEthPrice } from 'nft/utils/currency' import { isAudio } from 'nft/utils/isAudio' import { isVideo } from 'nft/utils/isVideo' import { putCommas } from 'nft/utils/putCommas' -import { fallbackProvider, getRarityProviderLogo } from 'nft/utils/rarity' import { useCallback, useMemo, useReducer, useState } from 'react' import InfiniteScroll from 'react-infinite-scroll-component' import { useInfiniteQuery, useQuery } from 'react-query' @@ -424,7 +423,6 @@ export const AssetDetails = ({ asset, collection }: AssetDetailsProps) => { const rarity = asset?.rarity?.providers?.[0] const [showHolder, setShowHolder] = useState(false) - const rarityProviderLogo = getRarityProviderLogo(rarity?.provider) return ( @@ -456,11 +454,9 @@ export const AssetDetails = ({ asset, collection }: AssetDetailsProps) => { text={ - cardLogo + cardLogo - - {`Ranking by ${rarity.provider === 'Genie' ? fallbackProvider : rarity.provider}`} - + Ranking by Rarity Sniper } placement="top" diff --git a/src/nft/utils/index.ts b/src/nft/utils/index.ts index a07f02dd43..724eab1f90 100644 --- a/src/nft/utils/index.ts +++ b/src/nft/utils/index.ts @@ -12,7 +12,6 @@ export * from './listNfts' export * from './numbers' export * from './pooledAssets' export * from './putCommas' -export * from './rarity' export * from './roundAndPluralize' export * from './timeSince' export * from './transactionResponse' diff --git a/src/nft/utils/rarity.ts b/src/nft/utils/rarity.ts deleted file mode 100644 index f639192761..0000000000 --- a/src/nft/utils/rarity.ts +++ /dev/null @@ -1,16 +0,0 @@ -// change this if we change the fallback provider -export const fallbackProvider = 'PopRank' -export const fallbackProviderLogo = '/nft/logos/poprank.png' - -/** - * Add provider mappings based on provider name returned from the backend here - */ -export const rarityProviderLogo: { [key: string]: string } = { - 'Rarity Sniper': '/nft/svgs/gem.svg', - Genie: fallbackProviderLogo, -} - -export const getRarityProviderLogo = (source?: string): string | undefined => { - if (!source) return undefined - return rarityProviderLogo[source] || fallbackProviderLogo -}