From fbc112f6452851a7a2ee14593e2eab964079627a Mon Sep 17 00:00:00 2001 From: Seok93 Date: Tue, 16 Jul 2024 16:11:46 +0900 Subject: [PATCH] =?UTF-8?q?Chore:=20#51=20TaskWithStatus=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EC=84=B8=EB=B6=84=ED=99=94=20=EB=B0=8F=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EC=82=AC=ED=95=AD=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/task/kanban/ProjectStatusContainer.tsx | 4 ++-- src/pages/project/KanbanPage.tsx | 8 ++++---- src/types/TaskType.tsx | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/components/task/kanban/ProjectStatusContainer.tsx b/src/components/task/kanban/ProjectStatusContainer.tsx index e23e9f05..a15523a5 100644 --- a/src/components/task/kanban/ProjectStatusContainer.tsx +++ b/src/components/task/kanban/ProjectStatusContainer.tsx @@ -6,10 +6,10 @@ import UpdateModalProjectStatus from '@components/modal/project-status/UpdateMod import { generatePrefixId } from '@utils/converter'; import { DND_DRAGGABLE_PREFIX } from '@constants/dnd'; import { BsPencil } from 'react-icons/bs'; -import { TaskWithStatus } from '@/types/TaskType'; +import { TaskListWithStatus } from '@/types/TaskType'; type TaskStatusContainerProps = { - statusTask: TaskWithStatus; + statusTask: TaskListWithStatus; }; export default function TaskStatusContainer({ statusTask }: TaskStatusContainerProps) { diff --git a/src/pages/project/KanbanPage.tsx b/src/pages/project/KanbanPage.tsx index 60e5b7d2..e3c66e03 100644 --- a/src/pages/project/KanbanPage.tsx +++ b/src/pages/project/KanbanPage.tsx @@ -5,9 +5,9 @@ import { DND_DROPPABLE_PREFIX, DND_TYPE } from '@constants/dnd'; import deepClone from '@utils/deepClone'; import { parsePrefixId } from '@utils/converter'; import { TASK_DUMMY } from '@mocks/mockData'; -import type { Task, TaskWithStatus } from '@/types/TaskType'; +import type { Task, TaskListWithStatus } from '@/types/TaskType'; -function createChangedStatus(statusTasks: TaskWithStatus[], dropResult: DropResult) { +function createChangedStatus(statusTasks: TaskListWithStatus[], dropResult: DropResult) { const { source, destination } = dropResult; if (!destination) throw Error('Error: DnD destination is null'); @@ -22,7 +22,7 @@ function createChangedStatus(statusTasks: TaskWithStatus[], dropResult: DropResu return newStatusTasks; } -function createChangedTasks(statusTasks: TaskWithStatus[], dropResult: DropResult, isSameStatus: boolean) { +function createChangedTasks(statusTasks: TaskListWithStatus[], dropResult: DropResult, isSameStatus: boolean) { const { source, destination, draggableId } = dropResult; // ToDo: 메세지 포맷 정하고 수정하기 @@ -50,7 +50,7 @@ function createChangedTasks(statusTasks: TaskWithStatus[], dropResult: DropResul // ToDo: DnD시 가시성을 위한 애니메이션 처리 추가할 것 export default function KanbanPage() { - const [statusTasks, setStatusTasks] = useState(TASK_DUMMY); + const [statusTasks, setStatusTasks] = useState(TASK_DUMMY); const handleDragEnd = (dropResult: DropResult) => { const { source, destination, type } = dropResult; diff --git a/src/types/TaskType.tsx b/src/types/TaskType.tsx index c0d4e541..138558c7 100644 --- a/src/types/TaskType.tsx +++ b/src/types/TaskType.tsx @@ -11,4 +11,5 @@ export type Task = { endDate: string; }; -export type TaskWithStatus = ProjectStatus & { tasks: Task[] }; +export type TaskWithStatus = ProjectStatus & Task; +export type TaskListWithStatus = ProjectStatus & { tasks: Task[] };