Skip to content

Commit

Permalink
Update bar max thickness and graph label
Browse files Browse the repository at this point in the history
  • Loading branch information
qlemaire22 committed Feb 15, 2024
1 parent d479c15 commit c8c7b3a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/components/widgets/GameLengthChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function GameLengthChart(props: GameLengthProps) {
intersect: false,
mode: "index",
},
maxBarThickness: 50,
plugins: {
title: {
display: false,
Expand Down
1 change: 0 additions & 1 deletion src/lib/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { League, Race } from "./api"
export const raceLabels: Record<Race, string> = {
infernals: "Infernals",
vanguard: "Vanguard",
random: "Random",
}

export const leagueLabels: Record<League, string> = {
Expand Down
5 changes: 3 additions & 2 deletions src/pages/players/[id]-[username]/statistics.astro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { GameLengthChart } from "../../../components/widgets/GameLengthChart"
import { Image } from "astro:assets"
import infernals from "../../../assets/game/factions/infernals-small.png"
import vanguard from "../../../assets/game/factions/vanguard-small.png"
import { raceLabels } from "../../../lib/labels"
const playerId = Astro.params.id!
Expand Down Expand Up @@ -99,14 +100,14 @@ if (dateLabels[dateLabels.length - 1] !== today) {
<GameLengthChart data={matchup.match_length} client:idle />
<div class="mt-4 flex items-center justify-center gap-2 text-gray-200">
<Image src={matchup.race === "infernals" ? infernals : vanguard} alt={matchup.race} class="size-6" />
<span>{matchup.race}</span>
<span>{raceLabels[matchup.race]}</span>
<span>vs</span>
<span>{matchup.opponent_race}</span>
<Image
src={matchup.opponent_race === "infernals" ? infernals : vanguard}
alt={matchup.opponent_race}
class="size-6"
/>
<span>{raceLabels[matchup.opponent_race]}</span>
</div>
</Widget>
))
Expand Down

0 comments on commit c8c7b3a

Please sign in to comment.