feat(TaskCard): implement end date selection and refine label styling

- Added useEffect to set the selected date based on task's end date for improved date management.
- Adjusted label styling for better visual consistency, including reduced border radius, padding, and updated color scheme based on theme mode.
This commit is contained in:
shancds
2025-07-04 12:31:25 +05:30
parent 7fe35d646a
commit 56f129d784

View File

@@ -68,6 +68,10 @@ const TaskCard: React.FC<TaskCardProps> = memo(({
return new Date(d.getFullYear(), d.getMonth(), 1);
});
useEffect(() => {
setSelectedDate(task.end_date ? new Date(task.end_date) : null);
}, [task.end_date]);
// Close date picker when clicking outside
useEffect(() => {
const handleClickOutside = (event: MouseEvent) => {
@@ -207,10 +211,10 @@ const TaskCard: React.FC<TaskCardProps> = memo(({
style={{
backgroundColor: label.color_code,
display: 'inline-block',
borderRadius: '4px',
padding: '2px 8px',
color: '#fff',
fontSize: 8,
borderRadius: '2px',
padding: '0px 4px',
color: themeMode === 'dark' ? '#181818' : '#fff',
fontSize: 10,
marginRight: 4,
whiteSpace: 'nowrap',
minWidth: 0