Polish PWA gestures, transitions and nutrition averages
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 32s
All checks were successful
Verify and publish Calio container / build-and-push (push) Successful in 32s
This commit is contained in:
parent
b19de6f9ea
commit
7288e56c02
16 changed files with 1019 additions and 245 deletions
|
|
@ -36,7 +36,12 @@ export function Settings({
|
|||
install: (() => void) | null;
|
||||
update: (() => void) | null;
|
||||
}) {
|
||||
const [draft, setDraft] = useState(settings);
|
||||
const [draft, setDraft] = useState({
|
||||
...settings,
|
||||
minimumAverageCalories:
|
||||
settings.minimumAverageCalories ??
|
||||
Math.round(settings.goals.calories.target / 2),
|
||||
});
|
||||
const tilt = useTilt();
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [format, setFormat] = useState(settings.exportFormat);
|
||||
|
|
@ -174,6 +179,40 @@ export function Settings({
|
|||
</label>
|
||||
</div>
|
||||
))}
|
||||
<div className="settings-section">
|
||||
<h3>Nutrition averages</h3>
|
||||
<label className="average-cutoff">
|
||||
Minimum calories for averages
|
||||
<span className="unit-input">
|
||||
<input
|
||||
aria-label="Minimum calories for averages"
|
||||
type="number"
|
||||
inputMode="numeric"
|
||||
min="0"
|
||||
max="100000"
|
||||
step="1"
|
||||
required
|
||||
value={draft.minimumAverageCalories}
|
||||
onChange={(event) =>
|
||||
setDraft({
|
||||
...draft,
|
||||
minimumAverageCalories:
|
||||
event.target.value === ""
|
||||
? ("" as unknown as number)
|
||||
: +event.target.value,
|
||||
})
|
||||
}
|
||||
/>
|
||||
<span>kcal</span>
|
||||
</span>
|
||||
</label>
|
||||
<p className="small muted">
|
||||
Days below this amount are treated as incomplete in every
|
||||
nutrition average. Starts at half your calorie target. Set to 0 to
|
||||
include all logged days. Charts and exports always keep every
|
||||
entry.
|
||||
</p>
|
||||
</div>
|
||||
<div className="settings-section">
|
||||
<h3>Look & feel</h3>
|
||||
<div className="preference-row">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue