feat: statuses dnd editor for mobile
This commit is contained in:
@ -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,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user