feat(01-02): integrate WeightInput and RepsInput into ExerciseCard set rows
- Import WeightInput and RepsInput in WorkoutPage.jsx - Replace bare <input type="number"> elements with stepper components - Update .set-inputs alignment to flex-start for taller steppers - Update .set-row alignment to flex-start - Remove now-redundant .weight-input and .reps-input CSS rules (main + mobile)
This commit is contained in:
+3
-25
@@ -281,7 +281,7 @@
|
|||||||
|
|
||||||
.set-row {
|
.set-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
padding: 0.75rem;
|
padding: 0.75rem;
|
||||||
background: var(--bg-secondary);
|
background: var(--bg-secondary);
|
||||||
@@ -303,25 +303,8 @@
|
|||||||
.set-inputs {
|
.set-inputs {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
gap: 0.5rem;
|
gap: 0.75rem;
|
||||||
}
|
|
||||||
|
|
||||||
.weight-input,
|
|
||||||
.reps-input {
|
|
||||||
width: 70px;
|
|
||||||
padding: 0.6rem;
|
|
||||||
background: var(--bg-card);
|
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: 6px;
|
|
||||||
color: var(--text-primary);
|
|
||||||
font-size: 1rem;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.weight-input:focus,
|
|
||||||
.reps-input:focus {
|
|
||||||
border-color: var(--accent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-separator {
|
.input-separator {
|
||||||
@@ -362,11 +345,6 @@
|
|||||||
padding: 0.75rem;
|
padding: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.weight-input,
|
|
||||||
.reps-input {
|
|
||||||
width: 60px;
|
|
||||||
padding: 0.5rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Safe area for notched phones */
|
/* Safe area for notched phones */
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect } from 'react'
|
||||||
import { Icon } from '../components/Icons'
|
import { Icon } from '../components/Icons'
|
||||||
|
import WeightInput from '../components/WeightInput'
|
||||||
|
import RepsInput from '../components/RepsInput'
|
||||||
|
|
||||||
// Uppvärmningsövningar baserat på muskelgrupp
|
// Uppvärmningsövningar baserat på muskelgrupp
|
||||||
const warmupExercises = {
|
const warmupExercises = {
|
||||||
@@ -324,22 +326,14 @@ function ExerciseCard({ exercise, logs, progression, expanded, onToggle, onLogSe
|
|||||||
<div key={setNum} className={`set-row ${input.completed ? 'completed' : ''}`}>
|
<div key={setNum} className={`set-row ${input.completed ? 'completed' : ''}`}>
|
||||||
<span className="set-number">Set {setNum}</span>
|
<span className="set-number">Set {setNum}</span>
|
||||||
<div className="set-inputs">
|
<div className="set-inputs">
|
||||||
<input
|
<WeightInput
|
||||||
type="number"
|
|
||||||
placeholder="kg"
|
|
||||||
value={input.weight}
|
value={input.weight}
|
||||||
onChange={(e) => handleInputChange(setNum, 'weight', e.target.value)}
|
onChange={(val) => handleInputChange(setNum, 'weight', val)}
|
||||||
className="weight-input"
|
|
||||||
inputMode="decimal"
|
|
||||||
/>
|
/>
|
||||||
<span className="input-separator">×</span>
|
<span className="input-separator">×</span>
|
||||||
<input
|
<RepsInput
|
||||||
type="number"
|
|
||||||
placeholder="reps"
|
|
||||||
value={input.reps}
|
value={input.reps}
|
||||||
onChange={(e) => handleInputChange(setNum, 'reps', e.target.value)}
|
onChange={(val) => handleInputChange(setNum, 'reps', val)}
|
||||||
className="reps-input"
|
|
||||||
inputMode="numeric"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user