@@ -76,6 +76,11 @@ export default function AllTasks({ user, todoList, setLoading }) {
76
76
return item ;
77
77
}
78
78
} ) ;
79
+ setUpdates ( {
80
+ title : result [ 0 ] . title ,
81
+ status : result [ 0 ] . status ,
82
+ isImportant : result [ 0 ] . isImportant
83
+ } ) ;
79
84
setCurrentItem ( result ) ;
80
85
} ;
81
86
@@ -90,9 +95,9 @@ export default function AllTasks({ user, todoList, setLoading }) {
90
95
} ;
91
96
92
97
const onEmojiClick = ( emojiObject ) => {
93
- setUpdates ( ( prevUpdates ) => ( {
94
- ...prevUpdates ,
95
- title : prevUpdates . title + emojiObject . emoji ,
98
+ setUpdates ( ( currentItem ) => ( {
99
+ ...currentItem ,
100
+ title : currentItem . title + emojiObject . emoji ,
96
101
} ) ) ;
97
102
setShowEmojiPicker ( false ) ;
98
103
} ;
@@ -115,7 +120,7 @@ export default function AllTasks({ user, todoList, setLoading }) {
115
120
116
121
return (
117
122
< >
118
- < ul className = " transition duration-300 ease-out" >
123
+ < ul className = "transition duration-300 ease-out " >
119
124
{ todoList ? (
120
125
todoList . length === 0 ? (
121
126
< motion . div
@@ -163,9 +168,9 @@ export default function AllTasks({ user, todoList, setLoading }) {
163
168
transition = { { delay : 0.25 } }
164
169
>
165
170
< div className = "flex gap-2" >
166
- < div className = { `${ item . status === "completed" && 'border-gray-600' } relative w- 11/12 h-auto p-2 bg-transparent transition ${ edit && item . id === currentItem ?. [ 0 ] ?. id ? "border-cyan-400 border-b-2" : "border-cyan-600 border-b" } flex justify-start items-center px-1` } >
171
+ < div className = { `${ item . status === "completed" && 'border-gray-600' } relative min-w-[400px] w- 11/12 h-auto p-2 bg-transparent transition ${ edit && item . id === currentItem ?. [ 0 ] ?. id ? "border-cyan-400 border-b-2" : "border-cyan-600 border-b" } flex justify-start items-center px-1` } >
167
172
< div className = "flex items-center gap-1" >
168
- { ! edit && item . id === currentItem ?. [ 0 ] ?. id } < Popconfirm
173
+ { ! edit && item . id === currentItem ?. [ 0 ] ?. id } < Popconfirm
169
174
title = { item . isImportant ? "Mark as not important" : "Mark as important" }
170
175
onConfirm = { ( ) => handleToggleImportant ( item . isImportant , item ) }
171
176
onCancel = { cancel }
@@ -189,7 +194,6 @@ export default function AllTasks({ user, todoList, setLoading }) {
189
194
{ edit && item . id === currentItem [ 0 ] . id ? (
190
195
< >
191
196
< input
192
- defaultValue = { item . title }
193
197
value = { updates . title }
194
198
onChange = { ( e ) => {
195
199
setUpdates ( ( prevUpdates ) => {
@@ -213,14 +217,13 @@ export default function AllTasks({ user, todoList, setLoading }) {
213
217
exit = { { opacity : 0 } }
214
218
transition = { { delay : 0.50 } }
215
219
className = "absolute right-6 top-10 z-10" ref = { pickerRef } >
216
- < Picker
217
- onEmojiClick = { onEmojiClick } />
220
+ < Picker onEmojiClick = { onEmojiClick } />
218
221
</ motion . div >
219
222
}
220
223
</ >
221
224
) : (
222
225
< motion . p
223
- className = { `${ item . status === "completed" ? 'line-through text-gray-400' : "" } decoration-white decoration-3 text-sm mt-0.5 ml-2 text-gray-300 font-semibold` }
226
+ className = { `${ item . status === "completed" ? 'line-through text-gray-400' : "" } overflow-hidden line-clamp-3 decoration-white decoration-3 text-sm mt-0.5 ml-2 text-gray-300 break-words ... font-semibold` }
224
227
initial = { { opacity : 0 , y : 5 } }
225
228
animate = { { opacity : 1 , y : 0 } }
226
229
exit = { { opacity : 0 , x : 5 } }
0 commit comments