Skip to content

Commit 5c91eec

Browse files
committed
chore: truncate leaderboard item
1 parent b3947f6 commit 5c91eec

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

frontend/app/components/leaderboard/LeaderboardItem.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ const colorClasses = [
1212
{ light: 'text-[#C47E49]!', dark: 'text-[#512012]!' },
1313
]
1414
15-
const getColorClasses = (rank: number | undefined, mode: 'dark' | 'light') => {
15+
const getColorClasses = (
16+
rank: number | undefined | null,
17+
mode: 'dark' | 'light',
18+
) => {
1619
if (!rank) return
1720
const color = colorClasses[rank - 1]
1821
if (color) {
@@ -45,11 +48,11 @@ const getColorClasses = (rank: number | undefined, mode: 'dark' | 'light') => {
4548
/>
4649
<span class="col-span-full row-span-full">{{ item.rank }}</span>
4750
</div>
48-
<div class="grow">
51+
<div class="grow truncate">
4952
<div class="flex gap-2">
5053
<p
5154
:class="[
52-
'text-label',
55+
'text-label truncate',
5356
{ 'text-accent-contrast': isMe, 'text-text-default': !isMe },
5457
]"
5558
>
@@ -70,7 +73,7 @@ const getColorClasses = (rank: number | undefined, mode: 'dark' | 'light') => {
7073
<Icon name="lucide:badge-check" class="size-3.5" />
7174
<span>{{ badge }}</span>
7275
</p>
73-
<p v-else-if="item.description" class="text-caption text-muted">
76+
<p v-else-if="item.description" class="text-caption text-muted truncate">
7477
{{ item.description }}
7578
</p>
7679
</div>

frontend/app/components/standings/StandingsLocal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ const leaderboard = computed<Partial<LeaderboardEntry>[]>(() => {
7777
v-model="entityType"
7878
:tabs="[
7979
{
80-
label: 'People',
80+
label: $t('standings.personal'),
8181
value: LeaderboardEntityType.Persons,
8282
icon: 'IconUser',
8383
},
8484
{
85-
label: 'Units',
85+
label: $t('standings.units'),
8686
value: LeaderboardEntityType.Teams,
8787
icon: 'IconUsers',
8888
},

frontend/i18n/locales/en.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
"local": "Local",
3131
"you": "You",
3232
"pointHistoryButton": "Point history",
33-
"getPointsButton": "Get points"
33+
"getPointsButton": "Get points",
34+
"units": "Units",
35+
"personal": "Personal"
3436
},
3537
"unit": {
3638
"unitLeader": "Unit leader",

frontend/i18n/locales/nb.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
"local": "Lokalt",
3131
"you": "Deg",
3232
"pointHistoryButton": "Poenghistorikk",
33-
"getPointsButton": "Få poeng"
33+
"getPointsButton": "Få poeng",
34+
"units": "Units",
35+
"personal": "Personlig"
3436
},
3537
"unit": {
3638
"editUnit": "Rediger unit",

0 commit comments

Comments
 (0)