feat: boards and statuses editing and creating for mobiles

This commit is contained in:
2025-08-08 15:01:10 +04:00
parent f52fde0097
commit afad1b4605
12 changed files with 109 additions and 23 deletions

View File

@ -0,0 +1,51 @@
"use client";
import { Button, Flex, rem, TextInput } from "@mantine/core";
import { useForm } from "@mantine/form";
import { ContextModalProps } from "@mantine/modals";
type Props = {
onComplete: (value: string) => void;
defaultValue?: string;
};
type FormType = {
name?: string;
};
const EnterNameModal = ({
id,
context,
innerProps,
}: ContextModalProps<Props>) => {
const form = useForm<FormType>({
initialValues: {
name: innerProps.defaultValue,
},
validate: {
name: name => !name && "Введите название",
},
});
const onSubmit = (values: FormType) => {
innerProps.onComplete(values.name!);
context.closeModal(id);
};
return (
<form onSubmit={form.onSubmit(values => onSubmit(values))}>
<Flex
gap={rem(10)}
direction={"column"}>
<TextInput {...form.getInputProps("name")} />
<Button
variant={"default"}
type={"submit"}>
Сохранить
</Button>
</Flex>
</form>
);
};
export default EnterNameModal;