diff --git a/striker-ui/components/Anvils/AnvilList.tsx b/striker-ui/components/Anvils/AnvilList.tsx index 2a86b54e..9738f6c9 100644 --- a/striker-ui/components/Anvils/AnvilList.tsx +++ b/striker-ui/components/Anvils/AnvilList.tsx @@ -13,11 +13,15 @@ import Anvil from './Anvil'; import { AnvilContext } from '../AnvilContext'; import sortAnvils from './sortAnvils'; -const useStyles = makeStyles(() => ({ +const useStyles = makeStyles((theme) => ({ root: { width: '100%', overflow: 'auto', height: '30vh', + [theme.breakpoints.down('md')]: { + height: '100%', + overflow: 'hidden', + }, }, divider: { background: DIVIDER, @@ -67,7 +71,7 @@ const AnvilList = ({ list }: { list: AnvilListItem[] }): JSX.Element => { const classes = useStyles(); useEffect(() => { - setAnvilUuid(sortAnvils(list)[0].anvil_uuid); + if (uuid === '') setAnvilUuid(sortAnvils(list)[0].anvil_uuid); }, [uuid, list, setAnvilUuid]); return ( diff --git a/striker-ui/components/Network.tsx b/striker-ui/components/Network.tsx index 6efc6f5b..aa335b9d 100644 --- a/striker-ui/components/Network.tsx +++ b/striker-ui/components/Network.tsx @@ -9,11 +9,15 @@ import { BLUE, PURPLE_OFF, DIVIDER } from '../lib/consts/DEFAULT_THEME'; import processNetworkData from './processNetwork'; import { AnvilContext } from './AnvilContext'; -const useStyles = makeStyles(() => ({ +const useStyles = makeStyles((theme) => ({ container: { width: '100%', overflow: 'auto', height: '30vh', + [theme.breakpoints.down('md')]: { + height: '100%', + overflow: 'hidden', + }, }, root: { paddingTop: '10px', diff --git a/striker-ui/components/Servers.tsx b/striker-ui/components/Servers.tsx index 354318bc..e0e3de1e 100644 --- a/striker-ui/components/Servers.tsx +++ b/striker-ui/components/Servers.tsx @@ -16,11 +16,14 @@ import { import { AnvilContext } from './AnvilContext'; import serverState from '../lib/consts/SERVERS'; -const useStyles = makeStyles(() => ({ +const useStyles = makeStyles((theme) => ({ root: { width: '100%', overflow: 'auto', - height: '100%', + height: '80vh', + [theme.breakpoints.down('md')]: { + height: '100%', + }, }, divider: { background: DIVIDER, @@ -79,61 +82,59 @@ const Servers = ({ anvil }: { anvil: AnvilListItem[] }): JSX.Element => { return ( - - {data && - data.servers.map((server: AnvilServer) => { - return ( - <> - - - -
+ + + {data && + data.servers.map((server: AnvilServer) => { + return ( + <> + + + +
+ + + + + + {server.server_state !== 'shut_off' && + server.server_state !== 'crashed' && + anvil[ + anvil.findIndex((a) => a.anvil_uuid === uuid) + ].nodes.map( + ( + node: AnvilListItemNode, + index: number, + ): JSX.Element => ( + + + + ), + )} - - - - - {server.server_state !== 'shut_off' && - server.server_state !== 'crashed' && - anvil[ - anvil.findIndex((a) => a.anvil_uuid === uuid) - ].nodes.map( - ( - node: AnvilListItemNode, - index: number, - ): JSX.Element => ( - - - - ), - )} - - - - - ); - })} - + + + + ); + })} + + ); };