From b322c969f2d39c8c083d19258f16d28ebdb2b023 Mon Sep 17 00:00:00 2001 From: "diana.dolgolyova" Date: Fri, 27 Mar 2026 23:54:16 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20schedule=20filters=20=E2=80=94=20restore?= =?UTF-8?q?=20status=20card=20design,=20responsive=20layout,=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Status: card layout on desktop, compact pills on mobile - Experience: compact pills with ? hover tooltips (unchanged) - Remove time presets (Morning/Day/Evening), keep only from-to inputs - Combine Days + Time into single "Когда" section - Fix tooltip overflow causing scrollbars (max-w + right-aligned) - Tighten modal spacing (p-6→px-6 py-4, space-y-7→space-y-5) - Clean unused imports (pillActive, pillInactive, User, Clock, etc.) --- .../sections/schedule/ScheduleFilters.tsx | 164 +++++++++--------- 1 file changed, 79 insertions(+), 85 deletions(-) diff --git a/src/components/sections/schedule/ScheduleFilters.tsx b/src/components/sections/schedule/ScheduleFilters.tsx index 7fec375..9559762 100644 --- a/src/components/sections/schedule/ScheduleFilters.tsx +++ b/src/components/sections/schedule/ScheduleFilters.tsx @@ -2,14 +2,10 @@ import { useState, useEffect, useRef } from "react"; import { createPortal } from "react-dom"; -import { User, X, Clock, SlidersHorizontal } from "lucide-react"; +import { X, SlidersHorizontal } from "lucide-react"; import { pillBase, - pillActive, - pillInactive, - TIME_PRESETS, isTimeFilterActive, - TIME_FILTER_EMPTY, type StatusTag, type TimeFilter, } from "./constants"; @@ -38,7 +34,6 @@ interface ScheduleFiltersProps { clearFilters: () => void; } -const divider = ; export function ScheduleFilters({ typeDots, @@ -60,7 +55,6 @@ export function ScheduleFilters({ toggleDay, trainerNames, scheduleConfig, - hasActiveFilter, clearFilters, }: ScheduleFiltersProps) { const [modalOpen, setModalOpen] = useState(false); @@ -130,7 +124,7 @@ export function ScheduleFilters({ {/* Scrollable content */} -
+
{/* Class types — gold border, white text; gold bg when active */}
@@ -163,37 +157,70 @@ export function ScheduleFilters({ {/* Status — gold tags */} {availableStatuses.length > 0 && ( -
+ {/* Desktop — card layout */} +
{availableStatuses.map((statusKey) => { const cfg = scheduleConfig?.statuses?.find((s) => s.key === statusKey); const label = cfg?.label || statusKey; const desc = cfg?.description; const active = filterStatusSet.has(statusKey); return ( - - + {desc && ( - - {desc} + e.stopPropagation()}> + ? + + {desc} + )} - + + ); + })} +
+ {/* Mobile — compact pills */} +
+ {availableStatuses.map((statusKey) => { + const cfg = scheduleConfig?.statuses?.find((s) => s.key === statusKey); + const label = cfg?.label || statusKey; + const active = filterStatusSet.has(statusKey); + return ( + ); })}
)} - {/* Level — gold tags with hover hints */} + {/* Level — radio cards */} {levels.length > 0 && (
@@ -201,20 +228,23 @@ export function ScheduleFilters({ const desc = scheduleConfig?.levels?.find((l) => l.value === level)?.description; const active = filterLevel === level; return ( - + {desc && ( - - {desc} + + ? + + {desc} + )} @@ -224,14 +254,14 @@ export function ScheduleFilters({ )} - {/* Days — calendar grid */} - -
+ {/* When — days + time combined */} + +
{availableDays.map(({ day, dayShort }) => ( ))}
-
- - {/* Time — from/to inputs + preset shortcuts */} - -
-
- - setFilterTime({ ...filterTime, from: e.target.value })} - className="w-full rounded-lg border border-white/[0.08] bg-white/[0.04] px-3 py-2 text-sm text-white outline-none focus:border-gold/40 transition-colors [color-scheme:dark]" - /> -
- -
- - setFilterTime({ ...filterTime, to: e.target.value })} - className="w-full rounded-lg border border-white/[0.08] bg-white/[0.04] px-3 py-2 text-sm text-white outline-none focus:border-gold/40 transition-colors [color-scheme:dark]" - /> -
-
-
- {TIME_PRESETS.map((preset) => { - const isActive = filterTime.from === preset.from && filterTime.to === preset.to; - return ( - - ); - })} +
+ setFilterTime({ ...filterTime, from: e.target.value })} + placeholder="С" + className="flex-1 rounded-lg border border-white/[0.08] bg-white/[0.04] px-3 py-1.5 text-xs text-white outline-none focus:border-gold/40 transition-colors [color-scheme:dark]" + /> + + setFilterTime({ ...filterTime, to: e.target.value })} + placeholder="До" + className="flex-1 rounded-lg border border-white/[0.08] bg-white/[0.04] px-3 py-1.5 text-xs text-white outline-none focus:border-gold/40 transition-colors [color-scheme:dark]" + />
@@ -347,18 +353,6 @@ function FilterSection({ title, hint, children }: { title: string; hint?: string ); } -function HintBubble({ text }: { text: string }) { - return ( - - - ? - - - {text} - - - ); -} function TrainerMultiSelect({ trainers,