diff --git a/striker-ui/pages/index.tsx b/striker-ui/pages/index.tsx index 78e9182e..c30a1a3a 100644 --- a/striker-ui/pages/index.tsx +++ b/striker-ui/pages/index.tsx @@ -11,13 +11,15 @@ import PeriodicFetch from '../lib/fetchers/periodicFetch'; import Servers from '../components/Servers'; import Header from '../components/Header'; import AnvilProvider from '../components/AnvilContext'; +import { LARGE_MOBILE_BREAKPOINT } from '../lib/consts/DEFAULT_THEME'; +import useWindowDimensions from '../hooks/useWindowDimenions'; const useStyles = makeStyles((theme) => ({ child: { width: '22%', height: '100%', - [theme.breakpoints.down('lg')]: { - width: '25%', + [theme.breakpoints.down(LARGE_MOBILE_BREAKPOINT)]: { + width: '50%', }, [theme.breakpoints.down('md')]: { width: '100%', @@ -26,9 +28,6 @@ const useStyles = makeStyles((theme) => ({ server: { width: '35%', height: '100%', - [theme.breakpoints.down('lg')]: { - width: '25%', - }, [theme.breakpoints.down('md')]: { width: '100%', }, @@ -46,6 +45,7 @@ const useStyles = makeStyles((theme) => ({ const Home = (): JSX.Element => { const classes = useStyles(); + const width = useWindowDimensions(); const { data } = PeriodicFetch( `${process.env.NEXT_PUBLIC_API_URL}/get_anvils`, @@ -55,25 +55,41 @@ const Home = (): JSX.Element => { <>
- {data?.anvils && ( - - - - - - - - - - + {data?.anvils && + width && + (width > LARGE_MOBILE_BREAKPOINT ? ( + + + + + + + + + + + + + + + + - - - - + ) : ( + + + + + + + + + + + + - - )} + ))} );