feat: styles for deal drawer
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import React, { FC } from "react";
|
||||
import { Stack, Text, TextInput } from "@mantine/core";
|
||||
import { Flex, Stack, TextInput } from "@mantine/core";
|
||||
import { useForm } from "@mantine/form";
|
||||
import Footer from "@/app/deals/drawers/DealEditorDrawer/tabs/GeneralTab/components/Footer";
|
||||
import BoardSelect from "@/components/selects/BoardSelect/BoardSelect";
|
||||
@ -40,27 +40,43 @@ const GeneralTab: FC<Props> = ({ value, onDelete, onChange }) => {
|
||||
return (
|
||||
<form onSubmit={form.onSubmit(onSubmit)}>
|
||||
<Stack p={"md"}>
|
||||
<TextInput
|
||||
label={"Название"}
|
||||
{...form.getInputProps("name")}
|
||||
/>
|
||||
<Text>
|
||||
Создано: {utcDateTimeToLocalString(value.createdAt)}
|
||||
</Text>
|
||||
<BoardSelect
|
||||
label={"Доска"}
|
||||
{...form.getInputProps("board")}
|
||||
onChange={board => {
|
||||
form.setFieldValue("board", board ?? undefined);
|
||||
form.setFieldValue("status", undefined);
|
||||
}}
|
||||
projectId={value.board.projectId}
|
||||
/>
|
||||
<StatusSelect
|
||||
label={"Статус"}
|
||||
{...form.getInputProps("status")}
|
||||
boardId={form.values.board?.id}
|
||||
/>
|
||||
<Flex
|
||||
gap={"md"}
|
||||
w={"100%"}
|
||||
direction={{ base: "column", sm: "row" }}>
|
||||
<TextInput
|
||||
label={"Название"}
|
||||
{...form.getInputProps("name")}
|
||||
flex={1}
|
||||
/>
|
||||
<TextInput
|
||||
label={"Дата создания"}
|
||||
value={utcDateTimeToLocalString(value.createdAt)}
|
||||
readOnly
|
||||
flex={1}
|
||||
/>
|
||||
</Flex>
|
||||
<Flex
|
||||
gap={"md"}
|
||||
w={"100%"}
|
||||
direction={{ base: "column", sm: "row" }}>
|
||||
<BoardSelect
|
||||
label={"Доска"}
|
||||
{...form.getInputProps("board")}
|
||||
onChange={board => {
|
||||
form.setFieldValue("board", board ?? undefined);
|
||||
form.setFieldValue("status", undefined);
|
||||
}}
|
||||
projectId={value.board.projectId}
|
||||
flex={1}
|
||||
/>
|
||||
<StatusSelect
|
||||
label={"Статус"}
|
||||
{...form.getInputProps("status")}
|
||||
boardId={form.values.board?.id}
|
||||
flex={1}
|
||||
/>
|
||||
</Flex>
|
||||
<Footer
|
||||
form={form}
|
||||
onDelete={() => onDelete(value)}
|
||||
|
||||
Reference in New Issue
Block a user