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

View File

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

View File

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