diff --git a/components/CalendarTab.tsx b/components/CalendarTab.tsx index 6b7b3f9..8f809b7 100644 --- a/components/CalendarTab.tsx +++ b/components/CalendarTab.tsx @@ -1,6 +1,6 @@ 'use client' import { useState, useEffect, useMemo } from 'react' -import { ChevronLeft, ChevronRight, Plus, X, Clock, MapPin, Trash2, Eye, EyeOff } from 'lucide-react' +import { ChevronLeft, ChevronRight, Plus, X, Clock, MapPin, Trash2, Eye, EyeOff, CalendarDays, User, AlignLeft } from 'lucide-react' interface CalendarEvent { id: string @@ -18,6 +18,15 @@ interface CalendarEvent { const WEEKDAYS = ['Пн', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс'] const MONTHS = ['Январь','Февраль','Март','Апрель','Май','Июнь','Июль','Август','Сентябрь','Октябрь','Ноябрь','Декабрь'] +function formatTime(iso: string): string { + return new Date(iso).toLocaleTimeString('ru-RU', { hour: '2-digit', minute: '2-digit' }) +} + +function formatFullDate(iso: string): string { + return new Date(iso).toLocaleDateString('ru-RU', { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }) +} + +// ————— Add Event Modal ————— function AddEventModal({ defaultDate, onClose, onSaved }: { defaultDate: string; onClose: () => void; onSaved: (e: any) => void }) { const [title, setTitle] = useState('') const [date, setDate] = useState(defaultDate) @@ -27,10 +36,11 @@ function AddEventModal({ defaultDate, onClose, onSaved }: { defaultDate: string; const [saving, setSaving] = useState(false) const [error, setError] = useState('') - const inputStyle = { - padding: '12px 16px', borderRadius: 14, + const inputStyle: React.CSSProperties = { + padding: '14px 18px', borderRadius: 14, background: 'rgba(255,255,255,0.05)', border: '1px solid rgba(255,255,255,0.08)', - color: 'var(--text-primary)', fontSize: 14, outline: 'none', fontFamily: 'inherit', + color: 'var(--text-primary)', fontSize: 15, outline: 'none', fontFamily: 'inherit', + width: '100%', } const save = async () => { @@ -46,30 +56,74 @@ function AddEventModal({ defaultDate, onClose, onSaved }: { defaultDate: string; } return ( -
-
e.stopPropagation()}> -
- Новое событие - +
+
e.stopPropagation()}> + {/* Header */} +
+
+
+ +
+ Новое событие +
+
-
- setTitle(e.target.value)} placeholder="Название события" autoFocus style={inputStyle} /> - setDate(e.target.value)} style={inputStyle} /> + +
+ {/* Title */} +
+ + setTitle(e.target.value)} placeholder="Встреча, звонок, задача..." autoFocus style={inputStyle} /> +
+ + {/* Date */} +
+ + setDate(e.target.value)} style={inputStyle} /> +
+ + {/* Time */} {!allDay && ( -
- setStartTime(e.target.value)} style={{ ...inputStyle, flex: 1 }} /> - setEndTime(e.target.value)} style={{ ...inputStyle, flex: 1 }} /> +
+ +
+ setStartTime(e.target.value)} style={{ ...inputStyle, flex: 1 }} /> + + setEndTime(e.target.value)} style={{ ...inputStyle, flex: 1 }} /> +
)} -