Skip to content

Conversation

@PMtHk
Copy link
Collaborator

@PMtHk PMtHk commented Dec 2, 2024

관련 이슈 번호

close #227

작업 내용

  • 드래그 앤 드롭 로직을 분리했습니다.
    • 이 과정에서 DropHandler 는 여전히 외부에 있는 것이 더 좋아보여서, 인자로 받도록 했습니다.
  • 칸반보드를 보드 / 섹션 / 태스크로 분리했습니다.

고민과 학습내용

태스크와 섹션 모두 더 분리를 할 수는 있을 것 같은데 오히려 흐름이 깨지는 것 같아서, 유지했습니다.
그리고, 섹션 안에 태스크가 들어가있으면 오히려 이해하기 어려울 것 같아
아래와 같이 구성했습니다.

<AnimatePresence mode="popLayout">
  {sections.map((section) => (
    <BoardSection
      key={section.id}
      section={section}
      isBelow={section.id === belowSectionId}
      onDrop={(e) => handleDrop(e, section.id)}
      onDragOver={(e) => handleDragOver(e, section.id)}
    >
      {section.tasks.map((task) => (
        <TaskCard
          key={task.id}
          task={task}
          isBelow={task.id === belowTaskId}
          onDragStart={(e) => handleDragStart(e, section.id, task.id)}
          onDragOver={(e) => handleDragOver(e, section.id, task.id)}
          onDragLeave={handleDragLeave}
          onDrop={(e) => handleDrop(e, section.id)}
          onTitleChange={handleTitleChange}
        />
      ))}
    </BoardSection>
  ))} 
</AnimatePresence>

@PMtHk PMtHk added Refactor 기능 추가, 오류 수정이 아닌 변경 FE 클라이언트 작업 labels Dec 2, 2024
@PMtHk PMtHk self-assigned this Dec 2, 2024
@PMtHk PMtHk linked an issue Dec 2, 2024 that may be closed by this pull request
2 tasks
@PMtHk PMtHk merged commit a0e5af0 into dev Dec 3, 2024
1 check passed
@PMtHk PMtHk deleted the refactor/#227 branch December 3, 2024 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FE 클라이언트 작업 Refactor 기능 추가, 오류 수정이 아닌 변경

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor] 칸반 보드 컴포넌트 분리로 가독성 개선

5 participants