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:
@@ -68,6 +68,10 @@ const TaskCard: React.FC<TaskCardProps> = memo(({
|
|||||||
return new Date(d.getFullYear(), d.getMonth(), 1);
|
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
|
// Close date picker when clicking outside
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleClickOutside = (event: MouseEvent) => {
|
const handleClickOutside = (event: MouseEvent) => {
|
||||||
@@ -207,10 +211,10 @@ const TaskCard: React.FC<TaskCardProps> = memo(({
|
|||||||
style={{
|
style={{
|
||||||
backgroundColor: label.color_code,
|
backgroundColor: label.color_code,
|
||||||
display: 'inline-block',
|
display: 'inline-block',
|
||||||
borderRadius: '4px',
|
borderRadius: '2px',
|
||||||
padding: '2px 8px',
|
padding: '0px 4px',
|
||||||
color: '#fff',
|
color: themeMode === 'dark' ? '#181818' : '#fff',
|
||||||
fontSize: 8,
|
fontSize: 10,
|
||||||
marginRight: 4,
|
marginRight: 4,
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
minWidth: 0
|
minWidth: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user