File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/lib/index/sections/workouts Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import type { Workout } from ' $lib/lcp/workouts' ;
3
3
import { Scrolling } from ' @gleich/ui' ;
4
+ import { onMount } from ' svelte' ;
4
5
5
6
const { workout }: { workout: Workout } = $props ();
7
+
8
+ let imperialUnits = $state (false );
9
+
10
+ onMount (() => {
11
+ imperialUnits = navigator .language === ' en-US' ;
12
+ });
6
13
</script >
7
14
8
15
<div class =" container" >
33
40
{set .type === ' warmup' ? ' Warmup' : ` Set #${setIndex + 1 } ` }
34
41
</div >
35
42
<div class =" set-value" >
36
- {Math .round (set .weight_kg * 2.2046226218 )} lbs × {set .reps } reps
43
+ {imperialUnits
44
+ ? ` ${Math .round (set .weight_kg * 2.2046226218 )} lbs `
45
+ : ` ${Math .round (set .weight_kg )}} kg ` } × {set .reps } reps
37
46
</div >
38
47
</div >
39
48
{/each }
You can’t perform that action at this time.
0 commit comments