Skip to content

Commit

Permalink
feat: 태스크 이동 위치 인디케이터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
PMtHk committed Nov 20, 2024
1 parent 1e9a27a commit 14539d7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
6 changes: 6 additions & 0 deletions apps/client/src/components/Kanban.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export default function Kanban({ sections, refetch }: KanbanProps) {
>
{section.tasks.map((task) => (
<KanbanTask
belowed={task.id === belowTaskId}
handleDragLeave={handleDragLeave}
handleDragOver={(e) =>
handleDragOver(e as unknown as DragEvent<HTMLDivElement>, section.id, task.id)
Expand All @@ -201,6 +202,11 @@ export default function Kanban({ sections, refetch }: KanbanProps) {
task={task}
/>
))}
<div
className={`mt-2 h-1 w-full rounded-full bg-blue-500 ${
activeSectionId === section.id && belowTaskId === -1 ? 'opacity-100' : 'opacity-0'
} transition-all`}
/>
</KanbanSection>
))}
<Button type="button" variant="outline" className="h-full w-36" disabled>
Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/components/KanbanSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export function KanbanSection({
</SectionMenu>
</SectionHeader>
<SectionContent
className="flex flex-1 flex-col gap-2 overflow-y-auto"
className="flex flex-1 flex-col overflow-y-auto"
onDragOver={onDragOver}
onDragLeave={onDragLeave}
onDrop={onDrop}
Expand Down
12 changes: 11 additions & 1 deletion apps/client/src/components/KanbanTask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ interface TaskProps {
handleDragOver: (e: DragEvent<HTMLDivElement>) => void;
handleDragLeave: () => void;
handleDragStart: (e: DragEvent<HTMLDivElement>) => void;
belowed: boolean;
}

function KanbanTask({ task, handleDragOver, handleDragLeave, handleDragStart }: TaskProps) {
function KanbanTask({
task,
handleDragOver,
handleDragLeave,
handleDragStart,
belowed,
}: TaskProps) {
const onDragOver = (e: DragEvent<HTMLDivElement>) => {
e.preventDefault();
e.stopPropagation();
Expand All @@ -27,6 +34,9 @@ function KanbanTask({ task, handleDragOver, handleDragLeave, handleDragStart }:
onDragOver={onDragOver}
onDragLeave={handleDragLeave}
>
<div
className={`my-1 h-1 w-full rounded-full bg-blue-500 ${belowed ? 'opacity-100' : 'opacity-0'} transition-all`}
/>
<Card className="bg-white transition-all duration-300">
<CardHeader className="flex flex-row items-start gap-2">
<CardTitle className="text-md mt-1.5 flex flex-1 break-keep">{task.title}</CardTitle>
Expand Down

0 comments on commit 14539d7

Please sign in to comment.