@@ -3,9 +3,9 @@ import styled from "styled-components";
33import { useParams } from "react-router-dom" ;
44import { useCourtDetails , CourtDetailsQuery } from "queries/useCourtDetails" ;
55import { useCoinPrice } from "hooks/useCoinPrice" ;
6- import { usePNKMainnetAddress , useWETHMainnetAddress } from "hooks/useContractAddress" ;
76import { formatETH , formatPNK , formatUnitsWei , formatUSD , isUndefined } from "utils/index" ;
87import { calculateSubtextRender } from "utils/calculateSubtextRender" ;
8+ import { CoinIds } from "consts/coingecko" ;
99import StatDisplay , { IStatDisplay } from "components/StatDisplay" ;
1010import { StyledSkeleton } from "components/StyledSkeleton" ;
1111import BalanceIcon from "svgs/icons/law-balance.svg" ;
@@ -96,14 +96,13 @@ const stats: IStat[] = [
9696const Stats = ( ) => {
9797 const { id } = useParams ( ) ;
9898 const { data } = useCourtDetails ( id ) ;
99- const coinIdToAddress = [ usePNKMainnetAddress ( ) , useWETHMainnetAddress ( ) ] ;
100- const { prices : pricesData } = useCoinPrice ( coinIdToAddress ) ;
99+ const coinIds = [ CoinIds . PNK , CoinIds . ETH ] ;
100+ const { prices : pricesData } = useCoinPrice ( coinIds ) ;
101101
102102 return (
103103 < StyledCard >
104104 { stats . map ( ( { title, coinId, getText, getSubtext, color, icon } , i ) => {
105- const coinPrice = ! isUndefined ( pricesData ) ? pricesData [ coinIdToAddress [ coinId ! ] ] ?. price : undefined ;
106-
105+ const coinPrice = ! isUndefined ( pricesData ) ? pricesData [ coinIds [ coinId ! ] ] ?. price : undefined ;
107106 return (
108107 < StatDisplay
109108 key = { i }
0 commit comments