@@ -25,15 +25,19 @@ export function TaskCard({ task, deleteTask, updateTask }) {
2525
2626 // ---- DESC AND TAG ---- */
2727
28+ if ( task . tags === undefined ) {
29+ task . tags = [ ] ;
30+ }
31+
2832 // Tags
2933 const tags =
3034 task . tags . length > 0 ? (
3135 < div className = "flex flex-wrap mx-3 mt-4" >
3236 { task . tags . map ( ( tag , index ) => (
3337 < div
3438 key = { index }
35- className = { `text-xs inline-flex items-center font-bold leading-sm uppercase px-2 py -1 bg-${ tag . color } -200 text-${ tag . color } -700 rounded-full ` } >
36- { tag . label }
39+ className = { `inline-flex items-center font-bold leading-sm uppercase w-1/3 h-3 p-2 mr -1 bg-${ tag . color } -200 text-${ tag . color } -700 rounded` } >
40+ < p className = "text-[9px] truncate" > { tag } </ p >
3741 </ div >
3842 ) ) }
3943 </ div >
@@ -42,16 +46,16 @@ export function TaskCard({ task, deleteTask, updateTask }) {
4246 // difficulty?
4347 const difficultyTag = task . difficulty ? (
4448 < span
45- className = { `text-[10px ] inline-flex items-center font-bold leading-sm uppercase px-2 py-1 rounded-full ${
49+ className = { `text-[9px ] inline-flex items-center font-bold leading-sm uppercase px-2 py-1 rounded-full ${
4650 task . difficulty === 1
4751 ? "bg-blue-200 text-blue-700"
4852 : task . difficulty === 2
4953 ? "bg-green-200 text-green-700"
5054 : task . difficulty === 3
5155 ? "bg-yellow-200 text-yellow-700"
5256 : task . difficulty === 4
53- ? "bg-purple -200 text-purple -700"
54- : "bg-red -200 text-red -700"
57+ ? "bg-red -200 text-red -700"
58+ : "bg-purple -200 text-purple -700"
5559 } `} >
5660 difficulty
5761 </ span >
@@ -60,7 +64,7 @@ export function TaskCard({ task, deleteTask, updateTask }) {
6064 // Due Date
6165 const dueDateTag =
6266 task . end_event && new Date ( task . end_event ) > new Date ( )
63- ? ( ( ) => {
67+ ? ( ( ) => {
6468 const daysUntilDue = Math . ceil ( ( new Date ( task . end_event ) - new Date ( ) ) / ( 1000 * 60 * 60 * 24 ) ) ;
6569
6670 let colorClass =
@@ -93,7 +97,7 @@ export function TaskCard({ task, deleteTask, updateTask }) {
9397
9498 // Subtask count
9599 const subtaskCountTag = task . subtaskCount ? (
96- < span className = "bg-green-200 text-green-600 text-[10px] font-xl font-bold me-2 px-2.5 py-0.5 rounded" >
100+ < span className = "flex flex-row items-center bg-green-200 text-green-600 text-[10px] font-xl font-bold me-2 px-2.5 py-0.5 rounded" >
97101 < GoChecklist /> { task . subtaskCount }
98102 </ span >
99103 ) : null ;
@@ -124,6 +128,7 @@ export function TaskCard({ task, deleteTask, updateTask }) {
124128 challenge = { task . challenge }
125129 importance = { task . importance }
126130 updateTask = { updateTask }
131+ completed = { task . completed }
127132 />
128133
129134 { /* -------- Task Card -------- */ }
@@ -138,7 +143,8 @@ export function TaskCard({ task, deleteTask, updateTask }) {
138143 } }
139144 onMouseLeave = { ( ) => {
140145 setMouseIsOver ( false ) ;
141- } } >
146+ } }
147+ onClick = { ( ) => document . getElementById ( `task_detail_modal_${ task . id } ` ) . showModal ( ) } >
142148 { /* -------- Task Content -------- */ }
143149 { /* Tags */ }
144150 { tags }
0 commit comments