feat: statuses dnd editor for mobile

This commit is contained in:
2025-08-09 17:07:45 +04:00
parent 9fb9e794db
commit 301821a682
7 changed files with 199 additions and 3 deletions

View File

@ -1,6 +1,12 @@
"use client";
import React, { createContext, FC, useContext, useEffect } from "react";
import React, {
createContext,
FC,
useContext,
useEffect,
useState,
} from "react";
import { useMutation, UseMutationResult } from "@tanstack/react-query";
import { AxiosError } from "axios";
import { useBoardsContext } from "@/app/deals/contexts/BoardsContext";
@ -29,6 +35,8 @@ type StatusesContextState = {
onCreateStatus: (name: string) => void;
onUpdateStatus: (statusId: number, status: UpdateStatusSchema) => void;
onDeleteStatus: (status: StatusSchema) => void;
isEditorDrawerOpened: boolean;
setIsEditorDrawerOpened: React.Dispatch<React.SetStateAction<boolean>>;
};
const StatusesContext = createContext<StatusesContextState | undefined>(
@ -44,6 +52,8 @@ const useStatusesContextState = () => {
} = useStatusesList({
boardId: selectedBoard?.id,
});
const [isEditorDrawerOpened, setIsEditorDrawerOpened] =
useState<boolean>(false);
useEffect(() => {
refetchStatuses();
@ -76,6 +86,8 @@ const useStatusesContextState = () => {
onCreateStatus,
onUpdateStatus,
onDeleteStatus,
isEditorDrawerOpened,
setIsEditorDrawerOpened,
};
};