Skip to content

Commit d5a439e

Browse files
Copilotnannany
andcommitted
完了タスクと未完了タスクの視覚的な区別を実装
Co-authored-by: nannany <14943122+nannany@users.noreply.github.com>
1 parent fc94a61 commit d5a439e

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

ui/src/components/task/SortableTask.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ const SortableTask = ({ task }: SortableTaskProps) => {
113113
...style,
114114
borderLeft: `4px solid ${categoryColor}`,
115115
}}
116-
className="flex items-center justify-between rounded-md border p-4 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"
116+
className={`flex items-center justify-between rounded-md border p-4 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 ${
117+
isCompleted ? "bg-gray-50 opacity-70" : ""
118+
}`}
117119
onKeyDown={handleTaskKeyDown}
118120
data-task-id={task.id}
119121
{...attributes}
@@ -127,7 +129,11 @@ const SortableTask = ({ task }: SortableTaskProps) => {
127129
<TaskTimerButton task={task} categoryColor={categoryColor} />
128130

129131
<div className="flex-grow">
130-
<TaskTitleField task={task} categoryColor={categoryColor} />
132+
<TaskTitleField
133+
task={task}
134+
categoryColor={categoryColor}
135+
isCompleted={isCompleted}
136+
/>
131137

132138
<div className="flex gap-3 text-sm text-muted-foreground">
133139
<TaskEstimatedTimeField task={task} categoryColor={categoryColor} />

ui/src/components/task/TaskTitleField.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import { useTaskContext } from "@/contexts/TaskContext";
55
interface TaskTitleFieldProps {
66
task: Task;
77
categoryColor?: string;
8+
isCompleted?: boolean;
89
}
910

1011
export const TaskTitleField = ({
1112
task,
1213
categoryColor = "#374151",
14+
isCompleted = false,
1315
}: TaskTitleFieldProps) => {
1416
// TaskContextから必要な値を取得
1517
const { taskEdit } = useTaskContext();
@@ -39,8 +41,10 @@ export const TaskTitleField = ({
3941

4042
return (
4143
<p
42-
className="font-medium mb-2 cursor-pointer hover:bg-gray-50 p-1 rounded"
43-
style={{ color: categoryColor }}
44+
className={`font-medium mb-2 cursor-pointer hover:bg-gray-50 p-1 rounded ${
45+
isCompleted ? "line-through text-gray-500" : ""
46+
}`}
47+
style={{ color: isCompleted ? undefined : categoryColor }}
4448
onClick={() => handleEditStart(task.id, "title", task.title)}
4549
>
4650
{task.title}

0 commit comments

Comments
 (0)