Skip to content

Commit

Permalink
show gamemode in top players
Browse files Browse the repository at this point in the history
  • Loading branch information
Aero56 committed Feb 18, 2024
1 parent 4e8219d commit 17ce3cb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/TopPlayers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,21 @@ const TopPlayers = () => {
>
{rank}
</div>
<p className="font-medium">{player.username}</p>
<div className="flex items-center gap-1">
{player.gamemode && (
<img
src={
new URL(
`../assets/modes/${player.gamemode}.png`,
import.meta.url,
).href
}
alt={`${player.gamemode} icon`}
className="h-4 w-4 object-contain"
/>
)}
<p className="font-medium">{player.username}</p>
</div>
</div>
<p className="font-semibold text-anzac-400">
{player.total_score}
Expand Down
1 change: 1 addition & 0 deletions src/types/supabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export interface Database {
id: string | null;
total_score: number | null;
username: string | null;
gamemode: Database['public']['Enums']['gamemode_enum'] | null;
};
Relationships: [
{
Expand Down

0 comments on commit 17ce3cb

Please sign in to comment.