remove empty line and add empty cells for calendar month start alignment
This commit is contained in:
@@ -28,7 +28,6 @@ services:
|
|||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useState, useEffect, useMemo } from 'react';
|
import { useState, useEffect, useMemo } from 'react';
|
||||||
import { Plus, Printer, ChevronRight, CalendarDays } from 'lucide-react';
|
import { Plus, Printer, ChevronRight, CalendarDays } from 'lucide-react';
|
||||||
import { format, startOfMonth, endOfMonth, eachDayOfInterval, isToday } from 'date-fns';
|
import { format, startOfMonth, endOfMonth, eachDayOfInterval, isToday, getDay } from 'date-fns';
|
||||||
import { ru } from 'date-fns/locale';
|
import { ru } from 'date-fns/locale';
|
||||||
import { useDeliveryStore } from '../stores/deliveryStore';
|
import { useDeliveryStore } from '../stores/deliveryStore';
|
||||||
import type { Delivery } from '../types';
|
import type { Delivery } from '../types';
|
||||||
@@ -149,6 +149,9 @@ const Dashboard = ({ onDateSelect, onAddDelivery }: DashboardProps) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid grid-cols-7 gap-1">
|
<div className="grid grid-cols-7 gap-1">
|
||||||
|
{Array.from({ length: (getDay(startOfMonth(currentMonth)) + 6) % 7 }).map((_, i) => (
|
||||||
|
<div key={`empty-${i}`} className="p-3 min-h-[80px]" />
|
||||||
|
))}
|
||||||
{days.map((day) => {
|
{days.map((day) => {
|
||||||
const count = getCountForDate(day);
|
const count = getCountForDate(day);
|
||||||
const isTodayDate = isToday(day);
|
const isTodayDate = isToday(day);
|
||||||
|
|||||||
Reference in New Issue
Block a user