From f90f5734e86844e864c18faff0931a949796ab6f Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Wed, 5 Feb 2025 02:33:46 +0100 Subject: [PATCH] Lib: Simplify SubstitutionCard --- .../components/cards/SubstitutionCard.svelte | 286 ++++++++---------- .../data/season/substitutions/+page.svelte | 89 ++---- 2 files changed, 153 insertions(+), 222 deletions(-) diff --git a/src/lib/components/cards/SubstitutionCard.svelte b/src/lib/components/cards/SubstitutionCard.svelte index 0910542..f512587 100644 --- a/src/lib/components/cards/SubstitutionCard.svelte +++ b/src/lib/components/cards/SubstitutionCard.svelte @@ -1,191 +1,157 @@ - modalStore.close()} -> -
- - - {#if substitution && !disable_inputs} - - {/if} - -
- - (drivers, "id", substitution?.substitute ?? "")?.headshot_url ?? + get_driver_headshot_template(graphics)} + imgid="headshot_preview" + width="w-full sm:w-auto" + imgwidth={DRIVER_HEADSHOT_WIDTH} + imgheight={DRIVER_HEADSHOT_HEIGHT} + imgonclick={(event: Event) => modalStore.close()} + > + modalStore.close()} > - Substitute - - - - - For - - - - - Race - - - -
- {#if substitution} - - - {:else} - + + + {#if substitution && !disabled} + {/if} -
-
-
-
+ +
+ + + Substitute + + + + + For + + + + {#await data.races then races} + + Race + + {/await} + + +
+ {#if substitution} + + + {:else} + + {/if} +
+
+ + + {/await} +{/await} diff --git a/src/routes/data/season/substitutions/+page.svelte b/src/routes/data/season/substitutions/+page.svelte index e5cb231..2cb801d 100644 --- a/src/routes/data/season/substitutions/+page.svelte +++ b/src/routes/data/season/substitutions/+page.svelte @@ -1,28 +1,35 @@
-
{#await data.substitutions then substitutions} - +
{/await}