💄 Change module enabler layout

This commit is contained in:
ajnart
2022-06-11 19:43:01 +02:00
parent 4866fd74b5
commit 437807a9e0

View File

@@ -1,4 +1,4 @@
import { Group, Switch } from '@mantine/core';
import { Checkbox, Group, SimpleGrid, Title } from '@mantine/core';
import * as Modules from '../modules';
import { useConfig } from '../../tools/state';
@@ -7,12 +7,14 @@ export default function ModuleEnabler(props: any) {
const modules = Object.values(Modules).map((module) => module);
return (
<Group direction="column">
<Title order={4}>Module enabler</Title>
<SimpleGrid cols={3} spacing="xl">
{modules.map((module) => (
<Switch
<Checkbox
key={module.title}
size="md"
checked={config.modules?.[module.title]?.enabled ?? false}
label={`Enable ${module.title}`}
label={`${module.title}`}
onChange={(e) => {
setConfig({
...config,
@@ -27,6 +29,7 @@ export default function ModuleEnabler(props: any) {
}}
/>
))}
</SimpleGrid>
</Group>
);
}