Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
🚸 Display the vehicle tier
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Jul 4, 2023
1 parent 4a5e2a5 commit 1a300a2
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/web/partials/vehicle_card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ impl Render for VehicleCard {
.has-text-warning-dark[self.vehicle.availability == VehicleAvailability::Premium]
.has-text-info-dark[self.vehicle.availability == VehicleAvailability::Collectible]
{
(self.vehicle.name)
span."mr-3" { (tier(self.vehicle.tier)) }
span { (self.vehicle.name) }
}
}
}
Expand Down Expand Up @@ -170,3 +171,20 @@ impl Render for VehicleCard {
}
}
}

#[inline]
const fn tier(tier: u8) -> &'static str {
match tier {
1 => "Ⅰ",
2 => "Ⅱ",
3 => "Ⅲ",
4 => "Ⅳ",
5 => "Ⅴ",
6 => "Ⅵ",
7 => "Ⅶ",
8 => "Ⅷ",
9 => "Ⅸ",
10 => "Ⅹ",
_ => "",
}
}

0 comments on commit 1a300a2

Please sign in to comment.