Client - use imperial units in user profile

This commit is contained in:
Sam 2021-11-14 14:53:25 +01:00
parent f867ad7a4b
commit c069e7ff0c
2 changed files with 13 additions and 5 deletions

View File

@ -49,7 +49,7 @@
unitTo.value, unitTo.value,
digits.value digits.value
) )
: distance.value : distance.value.toFixed(digits.value)
) )
</script> </script>

View File

@ -11,10 +11,16 @@
</span> </span>
</div> </div>
<div class="user-stat"> <div class="user-stat">
<span class="stat-number">{{ <Distance
Number(user.total_distance).toFixed(0) :distance="user.total_distance"
}}</span> unitFrom="km"
<span class="stat-label">km</span> :digits="0"
:displayUnit="false"
:useImperialUnits="user.imperial_units"
/>
<span class="stat-label">
{{ user.imperial_units ? 'mi' : 'km' }}
</span>
</div> </div>
<div class="user-stat hide-small"> <div class="user-stat hide-small">
<span class="stat-number">{{ user.nb_sports }}</span> <span class="stat-number">{{ user.nb_sports }}</span>
@ -72,6 +78,7 @@
.stat-label { .stat-label {
padding: 0 $default-padding * 0.5; padding: 0 $default-padding * 0.5;
} }
::v-deep(.distance),
.stat-number { .stat-number {
font-weight: bold; font-weight: bold;
font-size: 1.5em; font-size: 1.5em;
@ -87,6 +94,7 @@
.user-stats { .user-stats {
gap: $default-padding * 2; gap: $default-padding * 2;
.user-stat { .user-stat {
::v-deep(.distance),
.stat-number { .stat-number {
font-weight: bold; font-weight: bold;
font-size: 1.2em; font-size: 1.2em;