fix: fixed drawers sorting
This commit is contained in:
@ -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",
|
||||
|
||||
@ -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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user