From 62f20a905e936f7736fc32c59dda7d5ff300083f Mon Sep 17 00:00:00 2001 From: Aid Thompson Date: Wed, 24 Nov 2021 10:45:54 +0000 Subject: [PATCH] Alignment on Overview page --- explorer/src/components/StatsCard.tsx | 109 +++++++++++++++++--------- 1 file changed, 70 insertions(+), 39 deletions(-) diff --git a/explorer/src/components/StatsCard.tsx b/explorer/src/components/StatsCard.tsx index 44d15887a4..2e26c9ad26 100644 --- a/explorer/src/components/StatsCard.tsx +++ b/explorer/src/components/StatsCard.tsx @@ -1,5 +1,13 @@ import * as React from 'react'; -import { Box, Card, CardContent, IconButton, Typography } from '@mui/material'; +import { + Box, + Card, + CardContent, + IconButton, + Typography, + useMediaQuery, +} from '@mui/material'; +import { useTheme } from '@mui/material/styles'; import ArrowRightAltIcon from '@mui/icons-material/ArrowRightAlt'; interface StatsCardProps { @@ -15,46 +23,69 @@ export const StatsCard: React.FC = ({ count, onClick, errorMsg, -}) => ( - - - theme.palette.text.primary, fontSize: 18 }} +}) => { + const theme = useTheme(); + const matches = useMediaQuery(theme.breakpoints.down('sm')); + return ( + + - {icon} - - {count} - - - {title} - - - - - - {errorMsg && ( - - {errorMsg} - - )} - - -); + {icon} + + + + {count} + + + {title} + + + + + + + {errorMsg && ( + + {errorMsg} + + )} + + + ); +}; StatsCard.defaultProps = { onClick: undefined,