Trening: komunikat przyczyny przy zablokowanym "Dodaj serie" (norma cwiczenia do dowiezienia / aktywny bonus w sesji)
This commit is contained in:
@@ -273,6 +273,7 @@ function ExerciseAccordion({
|
||||
inProgress,
|
||||
nextSetId,
|
||||
canAddExtra,
|
||||
addSetHint,
|
||||
onToggle,
|
||||
onRemove,
|
||||
onEditSet,
|
||||
@@ -286,6 +287,7 @@ function ExerciseAccordion({
|
||||
inProgress: boolean;
|
||||
nextSetId: string | null;
|
||||
canAddExtra: boolean;
|
||||
addSetHint: string | null;
|
||||
onToggle: () => void;
|
||||
onRemove: () => void;
|
||||
onEditSet: (set: SessionSet, index: number) => void;
|
||||
@@ -368,16 +370,15 @@ function ExerciseAccordion({
|
||||
))}
|
||||
</div>
|
||||
{inProgress && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
className="mt-2"
|
||||
onClick={onAddSet}
|
||||
disabled={!canAddExtra}
|
||||
>
|
||||
<Plus className="w-4 h-4" />
|
||||
Dodaj serię
|
||||
</Button>
|
||||
<div className="mt-2 flex flex-wrap items-center gap-x-3 gap-y-1">
|
||||
<Button variant="secondary" size="sm" onClick={onAddSet} disabled={!canAddExtra}>
|
||||
<Plus className="w-4 h-4" />
|
||||
Dodaj serię
|
||||
</Button>
|
||||
{!canAddExtra && addSetHint && (
|
||||
<p className="text-xs text-dim">{addSetHint}</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
@@ -794,6 +795,13 @@ export default function DayExecution() {
|
||||
inProgress={session.status === 'IN_PROGRESS'}
|
||||
nextSetId={nextSetId}
|
||||
canAddExtra={canAddExtra(ex.sets)}
|
||||
addSetHint={
|
||||
ex.sets.some((s) => s.planSetId != null && s.reps == null)
|
||||
? 'Najpierw zapisz wszystkie serie normowe tego ćwiczenia'
|
||||
: extraPending > 0
|
||||
? 'W sesji jest już niezapisana seria dodatkowa — najpierw ją uzupełnij'
|
||||
: null
|
||||
}
|
||||
onToggle={() => toggleEx(ex.id)}
|
||||
onRemove={() => removeExercise(ex)}
|
||||
onEditSet={(s, i) => {
|
||||
|
||||
Reference in New Issue
Block a user