Fix UI and Add shelf item button

This commit is contained in:
Thomas "ajnart" Camlong
2022-05-03 19:52:09 +02:00
parent 71d18a5aa6
commit d386902c71
5 changed files with 52 additions and 22 deletions

View File

@@ -17,10 +17,11 @@ import { useForm } from '@mantine/hooks';
import { motion } from 'framer-motion';
import { useState } from 'react';
import { Apps } from 'tabler-icons-react';
import { useConfig } from '../../tools/state';
import { ServiceType, ServiceTypeList } from '../../tools/types';
export default function AddItemShelfItem(props: any) {
const { additem: addItem } = props;
const { config, addService } = useConfig();
const [opened, setOpened] = useState(false);
const theme = useMantineTheme();
const form = useForm({
@@ -53,7 +54,7 @@ export default function AddItemShelfItem(props: any) {
</Center>
<form
onSubmit={form.onSubmit(() => {
addItem(form.values);
addService(form.values);
setOpened(false);
form.reset();
})}