Lib: Don't await graphics

This commit is contained in:
2025-02-18 01:20:32 +01:00
parent 2fb7a7d597
commit 34c8ef57bf
3 changed files with 251 additions and 274 deletions

View File

@ -147,9 +147,8 @@
};
</script>
{#await data.graphics then graphics}
<Card
imgsrc={driver?.headshot_url ?? get_driver_headshot_template(graphics)}
imgsrc={driver?.headshot_url ?? get_driver_headshot_template(data.graphics)}
imgid="headshot_preview"
width="w-full sm:w-auto"
imgwidth={DRIVER_HEADSHOT_WIDTH}
@ -158,22 +157,10 @@
>
<div class="flex flex-col gap-2">
<!-- Driver name input -->
<Input
bind:value={firstname_input_value}
autocomplete="off"
{labelwidth}
{disabled}
{required}
>
<Input bind:value={firstname_input_value} autocomplete="off" {labelwidth} {disabled} {required}>
First Name
</Input>
<Input
bind:value={lastname_input_value}
autocomplete="off"
{labelwidth}
{disabled}
{required}
>
<Input bind:value={lastname_input_value} autocomplete="off" {labelwidth} {disabled} {required}>
Last Name
</Input>
<Input
@ -236,4 +223,3 @@
</div>
</div>
</Card>
{/await}

View File

@ -173,9 +173,8 @@
};
</script>
{#await data.graphics then graphics}
<Card
imgsrc={race?.pictogram_url ?? get_race_pictogram_template(graphics)}
imgsrc={race?.pictogram_url ?? get_race_pictogram_template(data.graphics)}
imgid="pictogram_preview"
width="w-full sm:w-auto"
imgwidth={RACE_PICTOGRAM_WIDTH}
@ -269,12 +268,7 @@
<!-- Save/Delete buttons -->
<div class="flex justify-end gap-2">
<Button
onclick={clear_sprint}
color="secondary"
{disabled}
width={race ? "w-1/3" : "w-1/2"}
>
<Button onclick={clear_sprint} color="secondary" {disabled} width={race ? "w-1/3" : "w-1/2"}>
Remove Sprint
</Button>
{#if race}
@ -290,4 +284,3 @@
</div>
</div>
</Card>
{/await}

View File

@ -176,9 +176,8 @@
};
</script>
{#await data.graphics then graphics}
<Card
imgsrc={team?.banner_url ?? get_team_banner_template(graphics)}
imgsrc={team?.banner_url ?? get_team_banner_template(data.graphics)}
imgid="banner_preview"
width="w-full sm:w-auto"
imgwidth={TEAM_BANNER_WIDTH}
@ -233,7 +232,7 @@
<div class="inline-flex flex-nowrap items-center gap-2">
<span class="font-bold">Upload Logo</span>
<LazyImage
src={team?.logo_url ?? get_team_logo_template(graphics)}
src={team?.logo_url ?? get_team_logo_template(data.graphics)}
id="logo_preview"
imgwidth={32}
imgheight={32}
@ -255,4 +254,3 @@
</div>
</div>
</Card>
{/await}