fix: fixed drawers sorting

This commit is contained in:
2025-08-22 17:32:01 +04:00
parent b5753ed3a2
commit b105510c23
4 changed files with 33 additions and 23 deletions

View File

@ -2,15 +2,16 @@ import React, { FC } from "react";
import { Box, Group, Text } from "@mantine/core";
import { modals } from "@mantine/modals";
import BoardMenu from "@/app/deals/components/shared/BoardMenu/BoardMenu";
import { BoardSchema, UpdateBoardSchema } from "@/lib/client";
import { useProjectBoardsContext } from "@/app/deals/drawers/ProjectBoardsEditorDrawer/contexts/ProjectBoardsContext";
import { BoardSchema } from "@/lib/client";
type Props = {
board: BoardSchema;
onUpdateBoard: (boardId: number, board: UpdateBoardSchema) => void;
onDeleteBoard: (board: BoardSchema) => void;
};
const BoardMobile: FC<Props> = ({ board, onUpdateBoard, onDeleteBoard }) => {
const BoardMobile: FC<Props> = ({ board }) => {
const { onUpdateBoard, onDeleteBoard } = useProjectBoardsContext();
const startEditing = () => {
modals.openContextModal({
modal: "enterNameModal",

View File

@ -12,7 +12,7 @@ type Props = {
};
const BoardsDrawerBody: FC<Props> = ({ onClose }) => {
const { boards, onUpdateBoard, onDeleteBoard, project, onCreateBoard } =
const { boards, onUpdateBoard, project, onCreateBoard } =
useProjectBoardsContext();
const renderDraggable = () => (
@ -28,11 +28,7 @@ const BoardsDrawerBody: FC<Props> = ({ onClose }) => {
return (
<Group wrap={"nowrap"}>
{renderDraggable && renderDraggable(board)}
<BoardMobile
board={board}
onDeleteBoard={onDeleteBoard}
onUpdateBoard={onUpdateBoard}
/>
<BoardMobile board={board} />
</Group>
);
};