refactor(front-end): use state hook to enable and disable full display mode

main
Josue 4 years ago
parent 66c0e01b27
commit b536b317dc
  1. 6
      striker-ui/pages/server/[uuid].tsx

@ -43,7 +43,7 @@ const useStyles = makeStyles((theme) => ({
})); }));
const Server = (): JSX.Element => { const Server = (): JSX.Element => {
const [previewMode] = useState<boolean>(true); const [previewMode, setPreviewMode] = useState<boolean>(true);
const classes = useStyles(); const classes = useStyles();
const router = useRouter(); const router = useRouter();
@ -61,7 +61,7 @@ const Server = (): JSX.Element => {
(previewMode ? ( (previewMode ? (
<Box className={classes.container}> <Box className={classes.container}>
<Box className={classes.child}> <Box className={classes.child}>
<Preview /> <Preview setMode={setPreviewMode} />
<CPU /> <CPU />
<Memory /> <Memory />
</Box> </Box>
@ -74,7 +74,7 @@ const Server = (): JSX.Element => {
</Box> </Box>
) : ( ) : (
<Box className={classes.container}> <Box className={classes.container}>
<FullSize /> <FullSize setMode={setPreviewMode} />
</Box> </Box>
))} ))}
</> </>

Loading…
Cancel
Save