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,33 +147,20 @@
}; };
</script> </script>
{#await data.graphics then graphics} <Card
<Card imgsrc={driver?.headshot_url ?? get_driver_headshot_template(data.graphics)}
imgsrc={driver?.headshot_url ?? get_driver_headshot_template(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}
imgheight={DRIVER_HEADSHOT_HEIGHT} imgheight={DRIVER_HEADSHOT_HEIGHT}
imgonclick={(event: Event) => modalStore.close()} imgonclick={(event: Event) => modalStore.close()}
> >
<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
@ -235,5 +222,4 @@
{/if} {/if}
</div> </div>
</div> </div>
</Card> </Card>
{/await}

View File

@ -173,15 +173,14 @@
}; };
</script> </script>
{#await data.graphics then graphics} <Card
<Card imgsrc={race?.pictogram_url ?? get_race_pictogram_template(data.graphics)}
imgsrc={race?.pictogram_url ?? get_race_pictogram_template(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}
imgheight={RACE_PICTOGRAM_HEIGHT} imgheight={RACE_PICTOGRAM_HEIGHT}
imgonclick={(event: Event) => modalStore.close()} imgonclick={(event: Event) => modalStore.close()}
> >
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<!-- Driver name input --> <!-- Driver name input -->
<Input bind:value={name_value} autocomplete="off" {labelwidth} {disabled} {required}> <Input bind:value={name_value} autocomplete="off" {labelwidth} {disabled} {required}>
@ -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}
@ -289,5 +283,4 @@
{/if} {/if}
</div> </div>
</div> </div>
</Card> </Card>
{/await}

View File

@ -176,15 +176,14 @@
}; };
</script> </script>
{#await data.graphics then graphics} <Card
<Card imgsrc={team?.banner_url ?? get_team_banner_template(data.graphics)}
imgsrc={team?.banner_url ?? get_team_banner_template(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}
imgheight={TEAM_BANNER_HEIGHT} imgheight={TEAM_BANNER_HEIGHT}
imgonclick={(event: Event) => modalStore.close()} imgonclick={(event: Event) => modalStore.close()}
> >
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<!-- Team name input --> <!-- Team name input -->
<Input bind:value={name_value} autocomplete="off" {labelwidth} {disabled} {required}> <Input bind:value={name_value} autocomplete="off" {labelwidth} {disabled} {required}>
@ -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}
@ -254,5 +253,4 @@
{/if} {/if}
</div> </div>
</div> </div>
</Card> </Card>
{/await}