@@ -12,6 +12,7 @@ import JurorIcon from "svgs/icons/user.svg";
1212import { CoinIds } from "consts/coingecko" ;
1313import { useCoinPrice } from "hooks/useCoinPrice" ;
1414import { useHomePageContext , HomePageQuery , HomePageQueryDataPoints } from "hooks/useHomePageContext" ;
15+ import useIsDesktop from "hooks/useIsDesktop" ;
1516import { calculateSubtextRender } from "utils/calculateSubtextRender" ;
1617import { formatETH , formatPNK , formatUnitsWei , formatUSD } from "utils/format" ;
1718import { isUndefined } from "utils/index" ;
@@ -24,10 +25,10 @@ import { StyledSkeleton } from "components/StyledSkeleton";
2425const StyledCard = styled ( Card ) `
2526 width: auto;
2627 height: fit-content;
27- gap: 32px 0 ;
28- padding: ${ responsiveSize ( 16 , 32 ) } ;
28+ gap: 16px 8px ;
29+ padding: ${ responsiveSize ( 16 , 24 ) } ${ responsiveSize ( 8 , 24 ) } ;
2930 display: grid;
30- grid-template-columns: repeat(auto-fit, minmax(190px , 1fr));
31+ grid-template-columns: repeat(auto-fit, minmax(152px , 1fr));
3132` ;
3233
3334const getLastOrZero = ( src : HomePageQuery [ "counters" ] , stat : HomePageQueryDataPoints ) =>
@@ -53,7 +54,7 @@ const stats: IStat[] = [
5354 icon : PNKIcon ,
5455 } ,
5556 {
56- title : "ETH Paid to jurors " ,
57+ title : "ETH Paid" ,
5758 coinId : 1 ,
5859 getText : ( counters ) => formatETH ( getLastOrZero ( counters , "paidETH" ) ) ,
5960 getSubtext : ( counters , coinPrice ) =>
@@ -88,6 +89,8 @@ const Stats = () => {
8889 const { data } = useHomePageContext ( ) ;
8990 const coinIds = [ CoinIds . PNK , CoinIds . ETH ] ;
9091 const { prices : pricesData } = useCoinPrice ( coinIds ) ;
92+ const isDesktop = useIsDesktop ( ) ;
93+
9194 return (
9295 < StyledCard >
9396 { stats . map ( ( { title, coinId, getText, getSubtext, color, icon } , i ) => {
@@ -99,7 +102,7 @@ const Stats = () => {
99102 { ...{ title, color, icon } }
100103 text = { data ? getText ( data [ "counters" ] ) : < StyledSkeleton /> }
101104 subtext = { calculateSubtextRender ( data ? data [ "counters" ] : undefined , getSubtext , coinPrice ) }
102- isSmallDisplay = { false }
105+ isSmallDisplay = { ! isDesktop }
103106 />
104107 ) ;
105108 } ) }
0 commit comments