From 113e87c3198f05dd25d98df66ca8aa3c50f6657d Mon Sep 17 00:00:00 2001 From: Lawrence Forman Date: Sun, 9 Jun 2024 02:59:16 -0400 Subject: [PATCH] use Player component more misc fixes --- src/lib/components/contest-progress.svelte | 3 ++- src/routes/(app)/bracket/+page.svelte | 7 ++++--- src/routes/(app)/players/+page.svelte | 3 ++- src/routes/(app)/tournament/+page.svelte | 8 +++++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/lib/components/contest-progress.svelte b/src/lib/components/contest-progress.svelte index 9f26617..2e3342a 100644 --- a/src/lib/components/contest-progress.svelte +++ b/src/lib/components/contest-progress.svelte @@ -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; @@ -138,7 +139,7 @@
Winner: {#if t.rankings[0]?.name} - {t.rankings[0].name} + {:else} None {/if} diff --git a/src/routes/(app)/bracket/+page.svelte b/src/routes/(app)/bracket/+page.svelte index 88ae079..03f7542 100644 --- a/src/routes/(app)/bracket/+page.svelte +++ b/src/routes/(app)/bracket/+page.svelte @@ -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, @@ -127,7 +128,7 @@
    {#each data.rankings as player (player.address)}
  1. - {player.name}: + : {formatScore(player.score)}
  2. {/each} @@ -147,7 +148,7 @@ Match {i + 1} {#if match.rounds !== undefined} ({match.rounds} rounds) @@ -159,7 +160,7 @@
      {#each match.rankings as player (player.address)}
    1. - {player.name}: + : {player.score.toFixed(3)}
    2. {/each}
    diff --git a/src/routes/(app)/players/+page.svelte b/src/routes/(app)/players/+page.svelte index 21e4cfc..fc162d3 100644 --- a/src/routes/(app)/players/+page.svelte +++ b/src/routes/(app)/players/+page.svelte @@ -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; @@ -126,7 +127,7 @@ {#each players as player, i (player.address)}
  3. {i + 1}. - {player.name} + {player.created.toLocaleDateString()}
  4. {/each} diff --git a/src/routes/(app)/tournament/+page.svelte b/src/routes/(app)/tournament/+page.svelte index 7643538..89b621e 100644 --- a/src/routes/(app)/tournament/+page.svelte +++ b/src/routes/(app)/tournament/+page.svelte @@ -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, @@ -96,7 +97,7 @@ import { page } from "$app/stores";
      {#each data.rankings as player (player.address)}
    1. - {player.name}: + : {formatScore(player.score)}
    2. {/each} @@ -122,8 +123,9 @@ import { page } from "$app/stores";
        {#each bracket.rankings as player (player.address)}
      1. - {player.name}: - {formatScore(player.score)}
      2. + : + {formatScore(player.score)} + {/each}