Skip to content

Commit

Permalink
feat: display max hr
Browse files Browse the repository at this point in the history
  • Loading branch information
morteako committed Jan 6, 2025
1 parent 8f98c7c commit 5a992df
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion apps/frontend/src/components/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ export const TopBar = () => {
const { cadence, currentResistance } = useSmartTrainer();
const { heartRate } = useHeartRateMonitor();
const { activeWorkout } = useActiveWorkout();
const { data: laps, timeElapsed, distance, speed, smoothedPower } = useData();
const {
data: laps,
timeElapsed,
distance,
speed,
smoothedPower,
maxHeartRate,
} = useData();
const remainingTime = getRemainingTime(activeWorkout);

const secondsElapsed = Math.floor(timeElapsed / 1000);
Expand Down Expand Up @@ -56,6 +63,11 @@ export const TopBar = () => {
</Text>
<Text fontSize={unitFontSize}>bpm</Text>
</Center>
{maxHeartRate && (
<Text color={hrColor} fontSize={secondaryFontSize}>
Max: {maxHeartRate} bpm
</Text>
)}
</Stack>
<Stack spacing="0">
<Text fontSize={secondaryFontSize}>
Expand Down

0 comments on commit 5a992df

Please sign in to comment.