From a95d05e28b07a7e64aadb9c1fc1693cd3086f3e5 Mon Sep 17 00:00:00 2001 From: AlexSserb Date: Thu, 18 Sep 2025 09:50:06 +0400 Subject: [PATCH] feat: styles for deal drawer --- .../ToolPanelAction.module.css | 6 -- .../ToolPanelAction/ToolPanelAction.tsx | 26 -------- .../desktop/TopToolPanel/TopToolPanel.tsx | 14 ++--- .../DealEditorDrawer.module.css | 4 +- .../DealEditorDrawer/DealEditorDrawer.tsx | 5 +- .../components/DealEditorBody.tsx | 5 ++ .../tabs/GeneralTab/GeneralTab.tsx | 60 ++++++++++++------- .../ActionIconWithTip.module.css | 5 ++ .../ActionIconWithTip/ActionIconWithTip.tsx | 34 +++++++++++ .../ui/BaseTable/BaseTable.module.css | 11 ++++ src/components/ui/BaseTable/BaseTable.tsx | 6 +- .../components/DealServiceRow.tsx | 29 +++------ .../FulfillmentBaseTabBody.tsx | 3 +- .../components/LockCheckbox/LockCheckbox.tsx | 15 +++-- .../ProductView/ProductView.module.css | 29 +-------- .../components/ProductView/ProductView.tsx | 41 ++++++------- .../components/ProductServicesTable.tsx | 30 ++++++---- .../components/ProductViewActions.tsx | 25 ++++---- .../hooks/useProductServicesTableColumns.tsx | 34 +++++------ src/theme.ts | 2 +- 20 files changed, 199 insertions(+), 185 deletions(-) delete mode 100644 src/app/deals/components/desktop/ToolPanelAction/ToolPanelAction.module.css delete mode 100644 src/app/deals/components/desktop/ToolPanelAction/ToolPanelAction.tsx create mode 100644 src/components/ui/ActionIconWithTip/ActionIconWithTip.module.css create mode 100644 src/components/ui/ActionIconWithTip/ActionIconWithTip.tsx create mode 100644 src/components/ui/BaseTable/BaseTable.module.css diff --git a/src/app/deals/components/desktop/ToolPanelAction/ToolPanelAction.module.css b/src/app/deals/components/desktop/ToolPanelAction/ToolPanelAction.module.css deleted file mode 100644 index 54ea813..0000000 --- a/src/app/deals/components/desktop/ToolPanelAction/ToolPanelAction.module.css +++ /dev/null @@ -1,6 +0,0 @@ -.container { - width: min-content; - cursor: pointer; - padding: 6px; - height: 100%; -} diff --git a/src/app/deals/components/desktop/ToolPanelAction/ToolPanelAction.tsx b/src/app/deals/components/desktop/ToolPanelAction/ToolPanelAction.tsx deleted file mode 100644 index 0fec137..0000000 --- a/src/app/deals/components/desktop/ToolPanelAction/ToolPanelAction.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { FC, PropsWithChildren } from "react"; -import { ActionIcon, Box } from "@mantine/core"; -import style from "./ToolPanelAction.module.css"; - -type Props = { - onClick: () => void; -}; - -const ToolPanelAction: FC> = ({ - onClick, - children, -}) => { - return ( - - - {children} - - - ); -}; - -export default ToolPanelAction; diff --git a/src/app/deals/components/desktop/TopToolPanel/TopToolPanel.tsx b/src/app/deals/components/desktop/TopToolPanel/TopToolPanel.tsx index 55b1d96..bd96bd8 100644 --- a/src/app/deals/components/desktop/TopToolPanel/TopToolPanel.tsx +++ b/src/app/deals/components/desktop/TopToolPanel/TopToolPanel.tsx @@ -4,12 +4,12 @@ import { FC } from "react"; import { IconEdit, IconFilter, IconPlus } from "@tabler/icons-react"; import { Flex, Group, Indicator } from "@mantine/core"; import { modals } from "@mantine/modals"; -import ToolPanelAction from "@/app/deals/components/desktop/ToolPanelAction/ToolPanelAction"; import ViewSelector from "@/app/deals/components/desktop/ViewSelector/ViewSelector"; import { useDealsContext } from "@/app/deals/contexts/DealsContext"; import { useProjectsContext } from "@/app/deals/contexts/ProjectsContext"; import { DealsFiltersForm } from "@/app/deals/hooks/useDealsFilters"; import ProjectSelect from "@/components/selects/ProjectSelect/ProjectSelect"; +import ActionIconWithTip from "@/components/ui/ActionIconWithTip/ActionIconWithTip"; import { useDrawersContext } from "@/drawers/DrawersContext"; import useIsMobile from "@/hooks/utils/useIsMobile"; @@ -89,16 +89,16 @@ const TopToolPanel: FC = ({ view, setView }) => { disabled={!isChangedFilters} offset={3} size={8}> - + - + - + - - + + - + > = ({ return ( > = ({ body: { display: "flex", flexDirection: "column", - padding: 0, + padding: isMobile ? 0 : "var(--mantine-spacing-xs)", + height: "100vh", }, header: { paddingBlock: 0, diff --git a/src/app/deals/drawers/DealEditorDrawer/components/DealEditorBody.tsx b/src/app/deals/drawers/DealEditorDrawer/components/DealEditorBody.tsx index 49c19b2..df14681 100644 --- a/src/app/deals/drawers/DealEditorDrawer/components/DealEditorBody.tsx +++ b/src/app/deals/drawers/DealEditorDrawer/components/DealEditorBody.tsx @@ -3,6 +3,7 @@ import { IconEdit } from "@tabler/icons-react"; import { motion } from "framer-motion"; import { Box, Tabs } from "@mantine/core"; import GeneralTab from "@/app/deals/drawers/DealEditorDrawer/tabs/GeneralTab/GeneralTab"; +import useIsMobile from "@/hooks/utils/useIsMobile"; import { DealSchema, ProjectSchema } from "@/lib/client"; import { MODULES } from "@/modules/modules"; import styles from "../DealEditorDrawer.module.css"; @@ -15,6 +16,8 @@ type Props = { }; const DealEditorBody: FC = props => { + const isMobile = useIsMobile(); + const getTabPanel = (value: string, component: ReactNode): ReactNode => ( = props => { return ( = ({ value, onDelete, onChange }) => { return (
- - - Создано: {utcDateTimeToLocalString(value.createdAt)} - - { - form.setFieldValue("board", board ?? undefined); - form.setFieldValue("status", undefined); - }} - projectId={value.board.projectId} - /> - + + + + + + { + form.setFieldValue("board", board ?? undefined); + form.setFieldValue("status", undefined); + }} + projectId={value.board.projectId} + flex={1} + /> + +