style & explanation text

This commit is contained in:
Johannes Kirschbauer
2023-11-04 14:55:32 +01:00
parent 92eebd7ea7
commit 223b6bbca7
2 changed files with 22 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
import { setMachineSchema } from "@/api/machine/machine"; import { setMachineSchema } from "@/api/machine/machine";
import { useListClanModules } from "@/api/modules/modules"; import { useListClanModules } from "@/api/modules/modules";
import { Alert, AlertTitle, FormHelperText, Typography } from "@mui/material";
import Box from "@mui/material/Box"; import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip"; import Chip from "@mui/material/Chip";
import FormControl from "@mui/material/FormControl"; import FormControl from "@mui/material/FormControl";
@@ -38,7 +39,9 @@ export default function ClanModules(props: ClanModulesProps) {
} }
}); });
formHooks.setValue("modules", []); formHooks.setValue("modules", []);
}, [clanName, formHooks]); // Only re-run if global clanName has changed
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [clanName]);
const handleChange = ( const handleChange = (
event: SelectChangeEvent<CreateMachineForm["modules"]>, event: SelectChangeEvent<CreateMachineForm["modules"]>,
@@ -57,8 +60,20 @@ export default function ClanModules(props: ClanModulesProps) {
}); });
}; };
return ( return (
<div> <div className="my-4 flex w-full flex-col justify-center px-2">
<FormControl sx={{ m: 1, width: 300 }} disabled={isLoading}> <Alert severity="info">
<AlertTitle>Info</AlertTitle>
Optionally select some modules {" "}
<strong>
This will affect the configurable options in the next steps!
</strong>
<Typography variant="subtitle2" sx={{ mt: 2 }}>
For example, if you add &quot;xfce&quot;, some configuration options
for xfce will be added.
</Typography>
</Alert>
<FormControl sx={{ my: 2 }} disabled={isLoading}>
<InputLabel>Modules</InputLabel> <InputLabel>Modules</InputLabel>
<Select <Select
multiple multiple
@@ -80,6 +95,9 @@ export default function ClanModules(props: ClanModulesProps) {
</MenuItem> </MenuItem>
))} ))}
</Select> </Select>
<FormHelperText>
(Optional) Select clan modules to be added.
</FormHelperText>
</FormControl> </FormControl>
</div> </div>
); );

View File

@@ -96,6 +96,7 @@ function PureCustomConfig(props: PureCustomConfigProps) {
console.log({ configData }); console.log({ configData });
const setConfig = (data: IChangeEvent<any>) => { const setConfig = (data: IChangeEvent<any>) => {
console.log("config changed", { data });
setValue("config", data); setValue("config", data);
}; };