fix(TaskCard): improve UI and interaction for subtasks
- Adjusted styling for task and subtask elements to enhance visual consistency. - Updated subtask rendering to include priority color indicators based on theme mode. - Added click handling for subtask items to improve user interaction. - Refined layout and spacing for better usability and readability.
This commit is contained in:
@@ -246,10 +246,10 @@ const TaskCard: React.FC<TaskCardProps> = memo(({
|
||||
))}
|
||||
</div>
|
||||
<div className="task-content" style={{ display: 'flex', alignItems: 'center' }}>
|
||||
<div
|
||||
className="w-2 h-2 rounded-full"
|
||||
style={{ backgroundColor: task.priority_color || '#d9d9d9' }}
|
||||
/>
|
||||
<span
|
||||
className="w-2 h-2 rounded-full inline-block"
|
||||
style={{ backgroundColor: themeMode === 'dark' ? (task.priority_color_dark || task.priority_color || '#d9d9d9') : (task.priority_color || '#d9d9d9') }}
|
||||
></span>
|
||||
<div className="task-title" style={{ marginLeft: 8 }}>{task.name}</div>
|
||||
</div>
|
||||
|
||||
@@ -439,8 +439,19 @@ const TaskCard: React.FC<TaskCardProps> = memo(({
|
||||
{!task.sub_tasks_loading && Array.isArray(task.sub_tasks) && task.sub_tasks.length > 0 && (
|
||||
<ul className="space-y-1">
|
||||
{task.sub_tasks.map(sub => (
|
||||
<li key={sub.id} className="flex items-center gap-2 px-2 py-1 rounded hover:bg-gray-50 dark:hover:bg-gray-800">
|
||||
<li key={sub.id} onClick={e => handleCardClick(e, sub.id!)} className="flex items-center gap-2 px-2 py-1 rounded hover:bg-gray-50 dark:hover:bg-gray-800">
|
||||
{sub.priority_color || sub.priority_color_dark ? (
|
||||
<span
|
||||
className="w-2 h-2 rounded-full inline-block"
|
||||
style={{ backgroundColor: themeMode === 'dark' ? (sub.priority_color_dark || sub.priority_color || '#d9d9d9') : (sub.priority_color || '#d9d9d9') }}
|
||||
></span>
|
||||
) : null}
|
||||
<span className="flex-1 truncate text-xs text-gray-800 dark:text-gray-100">{sub.name}</span>
|
||||
<span
|
||||
className="task-due-date ml-2 text-[10px] text-gray-500 dark:text-gray-400"
|
||||
>
|
||||
{sub.end_date ? format(new Date(sub.end_date), 'MMM d, yyyy') : ''}
|
||||
</span>
|
||||
{sub.names && sub.names.length > 0 && (
|
||||
<AvatarGroup
|
||||
members={sub.names}
|
||||
|
||||
Reference in New Issue
Block a user