diff --git a/.replit b/.replit index 8003553..61099cd 100644 --- a/.replit +++ b/.replit @@ -18,10 +18,6 @@ externalPort = 80 localPort = 35345 externalPort = 3002 -[[ports]] -localPort = 37425 -externalPort = 3001 - [[ports]] localPort = 41353 externalPort = 3000 diff --git a/client/src/components/CalendarView.tsx b/client/src/components/CalendarView.tsx index 3cdb6b5..1cf393d 100644 --- a/client/src/components/CalendarView.tsx +++ b/client/src/components/CalendarView.tsx @@ -3,7 +3,8 @@ import { Card } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { ChevronLeft, ChevronRight, Calendar } from 'lucide-react'; -import { Task } from './TaskCard'; +import { Task, Label } from '@shared/schema'; +import { useQuery } from '@tanstack/react-query'; import { addDays, format, isSameDay, startOfWeek } from 'date-fns'; interface CalendarViewProps { @@ -16,6 +17,13 @@ export default function CalendarView({ tasks, onTaskDrop, onDateSelect }: Calend const [currentDate, setCurrentDate] = useState(new Date()); const [draggedTask, setDraggedTask] = useState(null); + // Fetch labels to get label colors + const { data: labels = [] } = useQuery({ + queryKey: ['/api/labels'], + staleTime: 5 * 60 * 1000, // 5 minutes cache + refetchOnWindowFocus: false, + }); + // Get two weeks starting from current week const startDate = startOfWeek(currentDate); const dates = Array.from({ length: 14 }, (_, i) => addDays(startDate, i)); @@ -122,25 +130,35 @@ export default function CalendarView({ tasks, onTaskDrop, onDateSelect }: Calend
- {dayTasks.slice(0, 3).map((task, taskIndex) => ( -
handleDragStart(task.id)} - onDragEnd={handleDragEnd} - className={`cursor-move ${draggedTask === task.id ? 'opacity-50' : ''}`} - data-testid={`calendar-task-${task.id}`} - > - { + // Find the label for this task + const taskLabel = task.labelId && labels.length > 0 ? labels.find(label => label.id === task.labelId) : null; + + return ( +
handleDragStart(task.id)} + onDragEnd={handleDragEnd} + className={`cursor-move ${draggedTask === task.id ? 'opacity-50' : ''}`} + data-testid={`calendar-task-${task.id}`} > -
- {task.title} -
- -
- ))} + +
+ {task.title} +
+
+
+ ); + })} {dayTasks.length > 3 && (