Plany: kontekst silowni w wierszu zakladek tygodni zamiast osobnego paska (krok 2)
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
useExercises,
|
||||
type PlanBody,
|
||||
} from '../../api/queries';
|
||||
import { CalendarX, Check, ChevronRight, Dumbbell, Unlink } from 'lucide-react';
|
||||
import { CalendarX, Check, ChevronRight, Unlink } from 'lucide-react';
|
||||
import {
|
||||
BackButton,
|
||||
Button,
|
||||
@@ -443,48 +443,47 @@ export default function PlanEditor() {
|
||||
{step === 2 && (
|
||||
<>
|
||||
{/* Zakładki tygodni (sticky pod topbarem): każdy tydzień z osobna,
|
||||
renderowany jest tylko panel aktywnej zakładki */}
|
||||
renderowany jest tylko panel aktywnej zakładki. Siłownia — cichy
|
||||
kontekst w tym samym wierszu (decyzja z kroku 1, filtruje katalog). */}
|
||||
<div className="sticky top-[55px] md:top-[59px] z-20 -mx-4 px-4 md:-mx-8 md:px-8 py-2 bg-bg/95 backdrop-blur">
|
||||
<Tabs
|
||||
tabs={editor.weeks.map((w, wi) => ({
|
||||
id: String(wi),
|
||||
label: (
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<span className="sm:hidden">T.{wi + 1}</span>
|
||||
<span className="hidden sm:inline">Tydzień {wi + 1}</span>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
'h-2 w-2 rounded-full',
|
||||
DOT_COLORS[weekSummary(wi, w, displayedDaysOf(editor.weeks, wi)).color],
|
||||
)}
|
||||
/>
|
||||
</span>
|
||||
),
|
||||
}))}
|
||||
active={String(activeWi)}
|
||||
onChange={(id) => setActiveWeek(parseInt(id, 10))}
|
||||
/>
|
||||
<div className="flex flex-wrap items-center gap-x-3 gap-y-1">
|
||||
<div className="min-w-0 flex-1 basis-full sm:basis-0">
|
||||
<Tabs
|
||||
tabs={editor.weeks.map((w, wi) => ({
|
||||
id: String(wi),
|
||||
label: (
|
||||
<span className="inline-flex items-center gap-1.5">
|
||||
<span className="sm:hidden">T.{wi + 1}</span>
|
||||
<span className="hidden sm:inline">Tydzień {wi + 1}</span>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
'h-2 w-2 rounded-full',
|
||||
DOT_COLORS[weekSummary(wi, w, displayedDaysOf(editor.weeks, wi)).color],
|
||||
)}
|
||||
/>
|
||||
</span>
|
||||
),
|
||||
}))}
|
||||
active={String(activeWi)}
|
||||
onChange={(id) => setActiveWeek(parseInt(id, 10))}
|
||||
/>
|
||||
</div>
|
||||
<p className="ml-auto shrink-0 text-[0.8125rem] text-dim sm:ml-0">
|
||||
{gymName ? `Siłownia: ${gymName}` : 'Bez siłowni'}
|
||||
{' · '}
|
||||
<button
|
||||
type="button"
|
||||
className="cursor-pointer font-semibold text-accent-text underline underline-offset-2"
|
||||
onClick={() => setStep(1)}
|
||||
>
|
||||
Zmień
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ref={panelRef} className="scroll-mt-28">
|
||||
{/* Przypomnienie wybranej siłowni (decyzja zapada w kroku 1 — filtruje katalog) */}
|
||||
<div className="mb-3 flex flex-wrap items-center gap-x-2.5 gap-y-1 rounded-xl border border-line bg-card px-4 py-2.5 text-[0.8125rem] text-dim">
|
||||
<Dumbbell className="h-4 w-4 shrink-0 text-accent-text" aria-hidden="true" />
|
||||
<span className="min-w-0">
|
||||
Siłownia: <span className="font-semibold text-ink">{gymName ?? 'bez siłowni'}</span>
|
||||
{' · '}
|
||||
{gymName ? 'katalog ćwiczeń z jej sprzętu' : 'pełny katalog ćwiczeń'}
|
||||
</span>
|
||||
<button
|
||||
type="button"
|
||||
className="ml-auto cursor-pointer font-semibold text-accent-text underline underline-offset-2"
|
||||
onClick={() => setStep(1)}
|
||||
>
|
||||
Zmień
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<WeekPanel
|
||||
index={activeWi}
|
||||
summary={weekSummaryActive}
|
||||
|
||||
Reference in New Issue
Block a user