Skip to content

Commit 0d1e16e

Browse files
committed
chore(frontend): adapt to new gql schema
1 parent 3475b80 commit 0d1e16e

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

apps/frontend/app/components/fitness.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export const getSetStatisticsTextToDisplay = (
8686
: `${statistic.reps} reps`,
8787
statistic.oneRm ? `${Number(statistic.oneRm).toFixed(1)} RM` : null,
8888
])
89+
.with(ExerciseLot.RepsAndDurationAndDistance, () => [
90+
`${displayDistanceWithUnit(unit, statistic.distance)} × ${statistic.reps}`,
91+
`${Number(statistic.duration).toFixed(2)} min`,
92+
])
8993
.exhaustive();
9094
};
9195

apps/frontend/app/routes/_dashboard.fitness.$action.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,6 +1466,12 @@ const ExerciseDisplay = (props: {
14661466
.with(ExerciseLot.RepsAndWeight, () => [false, false, true, true])
14671467
.with(ExerciseLot.RepsAndDuration, () => [true, false, false, true])
14681468
.with(ExerciseLot.DistanceAndDuration, () => [true, true, false, false])
1469+
.with(ExerciseLot.RepsAndDurationAndDistance, () => [
1470+
true,
1471+
true,
1472+
false,
1473+
true,
1474+
])
14691475
.exhaustive();
14701476
const toBeDisplayedColumns =
14711477
[durationCol, distanceCol, weightCol, repsCol].filter(Boolean).length + 1;
@@ -2314,6 +2320,13 @@ const SetDisplay = (props: {
23142320
isString(set.statistic.reps) &&
23152321
isString(set.statistic.weight),
23162322
)
2323+
.with(
2324+
ExerciseLot.RepsAndDurationAndDistance,
2325+
() =>
2326+
isString(set.statistic.reps) &&
2327+
isString(set.statistic.duration) &&
2328+
isString(set.statistic.distance),
2329+
)
23172330
.exhaustive()
23182331
}
23192332
onClick={async () => {

apps/frontend/app/routes/_dashboard.fitness.exercises.item.$id._index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,10 @@ export default function Page() {
531531
WorkoutSetPersonalBest.Weight,
532532
() => stat?.weight,
533533
)
534+
.with(
535+
WorkoutSetPersonalBest.Distance,
536+
() => stat?.distance,
537+
)
534538
.exhaustive();
535539
return {
536540
name: dayjsLib(h.workoutEndOn).format("DD/MM/YYYY"),
@@ -745,6 +749,9 @@ const DisplayPersonalBest = (props: {
745749
displayWeightWithUnit(unitSystem, set.statistic.weight),
746750
)
747751
.with(WorkoutSetPersonalBest.Pace, () => `${set.statistic.pace}/min`)
752+
.with(WorkoutSetPersonalBest.Distance, () =>
753+
displayDistanceWithUnit(unitSystem, set.statistic.distance),
754+
)
748755
.exhaustive()}
749756
</Text>
750757
<Group>

0 commit comments

Comments
 (0)