feat: add comment, creating refactor
This commit is contained in:
@@ -9,6 +9,7 @@ export type ClientSchema = {
|
||||
name: string;
|
||||
companyName: string;
|
||||
barcodeTemplate?: (BarcodeTemplateSchema | null);
|
||||
comment?: (string | null);
|
||||
details?: (ClientDetailsSchema | null);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ContextModalProps } from "@mantine/modals";
|
||||
import { Fieldset, TextInput } from "@mantine/core";
|
||||
import { Fieldset, Textarea, TextInput } from "@mantine/core";
|
||||
import { useForm } from "@mantine/form";
|
||||
import { ClientSchema } from "../../../../client";
|
||||
import BaseFormModal, {
|
||||
@@ -13,7 +13,7 @@ const ClientFormModal = ({
|
||||
context,
|
||||
id,
|
||||
innerProps,
|
||||
}: ContextModalProps<Props>) => {
|
||||
}: ContextModalProps<Props>) => {
|
||||
const isEditing = "onChange" in innerProps;
|
||||
|
||||
const initialValues: ClientSchema = isEditing
|
||||
@@ -28,6 +28,7 @@ const ClientFormModal = ({
|
||||
email: "",
|
||||
inn: undefined,
|
||||
},
|
||||
comment: "",
|
||||
};
|
||||
const form = useForm<ClientSchema>({
|
||||
initialValues: initialValues,
|
||||
@@ -63,6 +64,7 @@ const ClientFormModal = ({
|
||||
placeholder={"Введите название клиента"}
|
||||
{...form.getInputProps("name")}
|
||||
/>
|
||||
|
||||
</Fieldset>
|
||||
<Fieldset legend={"Дополнительная информация"}>
|
||||
<TextInput
|
||||
@@ -90,6 +92,12 @@ const ClientFormModal = ({
|
||||
placeholder={"Введите название компании"}
|
||||
{...form.getInputProps("companyName")}
|
||||
/>
|
||||
<Textarea
|
||||
label={"Комментарий"}
|
||||
placeholder={"Введите комментарий"}
|
||||
{...form.getInputProps("comment")}
|
||||
/>
|
||||
|
||||
</Fieldset>
|
||||
<Fieldset legend={"Настройки"}>
|
||||
<BarcodeTemplateSelect
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Button, Fieldset, Flex, rem, TextInput } from "@mantine/core";
|
||||
import { Button, Fieldset, Flex, rem, Textarea, TextInput } from "@mantine/core";
|
||||
import { useDealPageContext } from "../../../contexts/DealPageContext.tsx";
|
||||
import { useForm } from "@mantine/form";
|
||||
import { DealGeneralFormType } from "./DealEditDrawerGeneralTab.tsx";
|
||||
@@ -75,6 +75,12 @@ const ClientTab = () => {
|
||||
label={"ИНН"}
|
||||
{...form.getInputProps("client.details.inn")}
|
||||
/>
|
||||
<Textarea
|
||||
placeholder={"Введите комментарий"}
|
||||
label={"Комментарий"}
|
||||
{...form.getInputProps("client.comment")}
|
||||
/>
|
||||
|
||||
</Fieldset>
|
||||
</Flex>
|
||||
<Flex
|
||||
|
||||
Reference in New Issue
Block a user