Updated weight edit
Deploy / deploy-dev (push) Successful in 2m1s
Deploy / deploy-prod (push) Has been skipped

This commit is contained in:
Corey Blais
2026-06-16 10:33:34 -04:00
parent 1e98d55cb5
commit 4d3ab0b143
+4 -11
View File
@@ -7095,28 +7095,21 @@ function App() {
</form> </form>
<div className="recent-list"> <div className="recent-list">
{[...weights] {[...weights]
.filter(isWeightEditable)
.sort((left, right) => right.recordedOn.localeCompare(left.recordedOn)) .sort((left, right) => right.recordedOn.localeCompare(left.recordedOn))
.map((weight) => { .map((weight) => (
const weightCanBeEdited = isWeightEditable(weight);
return (
<article className="vet-visit-card" key={weight.id}> <article className="vet-visit-card" key={weight.id}>
<strong>{formatWeight(weight.weightGrams)}</strong> <strong>{formatWeight(weight.weightGrams)}</strong>
<span>{formatDate(weight.recordedOn)}</span> <span>{formatDate(weight.recordedOn)}</span>
<small>{weight.notes || 'No notes recorded.'}</small> <small>{weight.notes || 'No notes recorded.'}</small>
{weightCanBeEdited ? (
<div className="button-row"> <div className="button-row">
<button className="secondary-button" onClick={() => handleEditWeight(weight)} type="button"> <button className="secondary-button" onClick={() => handleEditWeight(weight)} type="button">
Edit Edit
</button> </button>
</div> </div>
) : (
<small>Editing available for the last 3 days only.</small>
)}
</article> </article>
); ))}
})} {!weights.some(isWeightEditable) ? <p className="muted">No editable weight entries from the last 3 days.</p> : null}
{!weights.length ? <p className="muted">No weight entries recorded yet.</p> : null}
</div> </div>
</section> </section>
</div> </div>