Skip to content

Commit

Permalink
use Player component more
Browse files Browse the repository at this point in the history
misc fixes
  • Loading branch information
merklejerk committed Jun 9, 2024
1 parent e62c7a0 commit 113e87c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/lib/components/contest-progress.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { base } from "$app/paths";
import { createBusy, type BusyState } from "$lib/kit";
import { onMount } from "svelte";
import Player from "./player.svelte";
interface TournamentResult {
id: string;
Expand Down Expand Up @@ -138,7 +139,7 @@
<div class="field">
Winner:
{#if t.rankings[0]?.name}
<a href={`${base}/player?name=${t.rankings[0].name}`}>{t.rankings[0].name}</a>
<Player name={t.rankings[0].name} />
{:else}
None
{/if}
Expand Down
7 changes: 4 additions & 3 deletions src/routes/(app)/bracket/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import CatSpinner from "$lib/components/cat-spinner.svelte";
import Lede from "$lib/components/lede.svelte";
import Page from "$lib/components/page.svelte";
import Player from "$lib/components/player.svelte";
import { createBusy, type BusyState } from "$lib/kit";
import {
formatScore,
Expand Down Expand Up @@ -127,7 +128,7 @@
<ol>
{#each data.rankings as player (player.address)}
<li>
<a href={`${base}/player?name=${player.name}`}>{player.name}</a>:
<Player name={player.name} />:
{formatScore(player.score)}
</li>
{/each}
Expand All @@ -147,7 +148,7 @@
Match {i + 1}
<a
class="smaller"
href={`${base}/match?tournament=${data.tournamentId}&season=${data.season + 1}&bracket=${data.bracket + 1}&match=${match.id}`}
href={`${base}/match?tournament=${data.tournamentId}&season=${data.season + 1}&bracket=${data.bracket + 1}&match=${match.id}&idx=${i+1}`}
>
{#if match.rounds !== undefined}
({match.rounds} rounds)
Expand All @@ -159,7 +160,7 @@
<ol>
{#each match.rankings as player (player.address)}
<li>
<a href={`${base}/player?name=${player.name}`}>{player.name}</a>:
<Player name={player.name} />:
{player.score.toFixed(3)}</li>
{/each}
</ol>
Expand Down
3 changes: 2 additions & 1 deletion src/routes/(app)/players/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { base } from "$app/paths";
import { createBusy, type BusyState } from "$lib/kit";
import { UserError, getFriendlyErrorMsg } from "$lib/util";
import Player from "$lib/components/player.svelte";
interface Player {
name: string;
Expand Down Expand Up @@ -126,7 +127,7 @@
{#each players as player, i (player.address)}
<li>
<span>{i + 1}.</span>
<span><a href={`${base}/player?name=${encodeURIComponent(player.name)}`}>{player.name}</a></span>
<span><Player name={player.name} /></span>
<span>{player.created.toLocaleDateString()}</span>
</li>
{/each}
Expand Down
8 changes: 5 additions & 3 deletions src/routes/(app)/tournament/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { page } from "$app/stores";
import CatSpinner from "$lib/components/cat-spinner.svelte";
import Lede from "$lib/components/lede.svelte";
import Page from "$lib/components/page.svelte";
import Player from "$lib/components/player.svelte";
import { createBusy, type BusyState } from "$lib/kit";
import {
formatScore,
Expand Down Expand Up @@ -96,7 +97,7 @@ import { page } from "$app/stores";
<ol>
{#each data.rankings as player (player.address)}
<li>
<a href={`${base}/player?name=${player.name}`}>{player.name}</a>:
<Player name={player.name} />:
{formatScore(player.score)}
</li>
{/each}
Expand All @@ -122,8 +123,9 @@ import { page } from "$app/stores";
<ol>
{#each bracket.rankings as player (player.address)}
<li>
<a href={`${base}/player?name=${player.name}`}>{player.name}</a>:
{formatScore(player.score)}</li>
<Player name={player.name} />:
{formatScore(player.score)}
</li>
{/each}
</ol>
</div>
Expand Down

0 comments on commit 113e87c

Please sign in to comment.