@@ -12,6 +12,7 @@ import JurorIcon from "svgs/icons/user.svg";
12
12
import { CoinIds } from "consts/coingecko" ;
13
13
import { useCoinPrice } from "hooks/useCoinPrice" ;
14
14
import { useHomePageContext , HomePageQuery , HomePageQueryDataPoints } from "hooks/useHomePageContext" ;
15
+ import useIsDesktop from "hooks/useIsDesktop" ;
15
16
import { calculateSubtextRender } from "utils/calculateSubtextRender" ;
16
17
import { formatETH , formatPNK , formatUnitsWei , formatUSD } from "utils/format" ;
17
18
import { isUndefined } from "utils/index" ;
@@ -24,10 +25,10 @@ import { StyledSkeleton } from "components/StyledSkeleton";
24
25
const StyledCard = styled ( Card ) `
25
26
width: auto;
26
27
height: fit-content;
27
- gap: 32px 0 ;
28
- padding: ${ responsiveSize ( 16 , 32 ) } ;
28
+ gap: 16px 8px ;
29
+ padding: ${ responsiveSize ( 16 , 24 ) } ${ responsiveSize ( 8 , 24 ) } ;
29
30
display: grid;
30
- grid-template-columns: repeat(auto-fit, minmax(190px , 1fr));
31
+ grid-template-columns: repeat(auto-fit, minmax(152px , 1fr));
31
32
` ;
32
33
33
34
const getLastOrZero = ( src : HomePageQuery [ "counters" ] , stat : HomePageQueryDataPoints ) =>
@@ -53,7 +54,7 @@ const stats: IStat[] = [
53
54
icon : PNKIcon ,
54
55
} ,
55
56
{
56
- title : "ETH Paid to jurors " ,
57
+ title : "ETH Paid" ,
57
58
coinId : 1 ,
58
59
getText : ( counters ) => formatETH ( getLastOrZero ( counters , "paidETH" ) ) ,
59
60
getSubtext : ( counters , coinPrice ) =>
@@ -88,6 +89,8 @@ const Stats = () => {
88
89
const { data } = useHomePageContext ( ) ;
89
90
const coinIds = [ CoinIds . PNK , CoinIds . ETH ] ;
90
91
const { prices : pricesData } = useCoinPrice ( coinIds ) ;
92
+ const isDesktop = useIsDesktop ( ) ;
93
+
91
94
return (
92
95
< StyledCard >
93
96
{ stats . map ( ( { title, coinId, getText, getSubtext, color, icon } , i ) => {
@@ -99,7 +102,7 @@ const Stats = () => {
99
102
{ ...{ title, color, icon } }
100
103
text = { data ? getText ( data [ "counters" ] ) : < StyledSkeleton /> }
101
104
subtext = { calculateSubtextRender ( data ? data [ "counters" ] : undefined , getSubtext , coinPrice ) }
102
- isSmallDisplay = { false }
105
+ isSmallDisplay = { ! isDesktop }
103
106
/>
104
107
) ;
105
108
} ) }
0 commit comments