File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff 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 } />
Original file line number Diff line number Diff line change @@ -5,11 +5,13 @@ import { useTaskContext } from "@/contexts/TaskContext";
55interface TaskTitleFieldProps {
66 task : Task ;
77 categoryColor ?: string ;
8+ isCompleted ?: boolean ;
89}
910
1011export 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 }
You can’t perform that action at this time.
0 commit comments