Plany: kontekst silowni w wierszu zakladek tygodni zamiast osobnego paska (krok 2)
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
|||||||
useExercises,
|
useExercises,
|
||||||
type PlanBody,
|
type PlanBody,
|
||||||
} from '../../api/queries';
|
} from '../../api/queries';
|
||||||
import { CalendarX, Check, ChevronRight, Dumbbell, Unlink } from 'lucide-react';
|
import { CalendarX, Check, ChevronRight, Unlink } from 'lucide-react';
|
||||||
import {
|
import {
|
||||||
BackButton,
|
BackButton,
|
||||||
Button,
|
Button,
|
||||||
@@ -443,48 +443,47 @@ export default function PlanEditor() {
|
|||||||
{step === 2 && (
|
{step === 2 && (
|
||||||
<>
|
<>
|
||||||
{/* Zakładki tygodni (sticky pod topbarem): każdy tydzień z osobna,
|
{/* 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">
|
<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
|
<div className="flex flex-wrap items-center gap-x-3 gap-y-1">
|
||||||
tabs={editor.weeks.map((w, wi) => ({
|
<div className="min-w-0 flex-1 basis-full sm:basis-0">
|
||||||
id: String(wi),
|
<Tabs
|
||||||
label: (
|
tabs={editor.weeks.map((w, wi) => ({
|
||||||
<span className="inline-flex items-center gap-1.5">
|
id: String(wi),
|
||||||
<span className="sm:hidden">T.{wi + 1}</span>
|
label: (
|
||||||
<span className="hidden sm:inline">Tydzień {wi + 1}</span>
|
<span className="inline-flex items-center gap-1.5">
|
||||||
<span
|
<span className="sm:hidden">T.{wi + 1}</span>
|
||||||
aria-hidden="true"
|
<span className="hidden sm:inline">Tydzień {wi + 1}</span>
|
||||||
className={cn(
|
<span
|
||||||
'h-2 w-2 rounded-full',
|
aria-hidden="true"
|
||||||
DOT_COLORS[weekSummary(wi, w, displayedDaysOf(editor.weeks, wi)).color],
|
className={cn(
|
||||||
)}
|
'h-2 w-2 rounded-full',
|
||||||
/>
|
DOT_COLORS[weekSummary(wi, w, displayedDaysOf(editor.weeks, wi)).color],
|
||||||
</span>
|
)}
|
||||||
),
|
/>
|
||||||
}))}
|
</span>
|
||||||
active={String(activeWi)}
|
),
|
||||||
onChange={(id) => setActiveWeek(parseInt(id, 10))}
|
}))}
|
||||||
/>
|
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>
|
||||||
|
|
||||||
<div ref={panelRef} className="scroll-mt-28">
|
<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
|
<WeekPanel
|
||||||
index={activeWi}
|
index={activeWi}
|
||||||
summary={weekSummaryActive}
|
summary={weekSummaryActive}
|
||||||
|
|||||||
Reference in New Issue
Block a user