From af87b5010abd129d262372653a8f54378d5cbcf5 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Sun, 15 Dec 2024 22:45:02 +0100 Subject: [PATCH] Add driver/team icons to driver/team dropdowns --- src/routes/data/season/+page.svelte | 74 +++++++++++++++-------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/src/routes/data/season/+page.svelte b/src/routes/data/season/+page.svelte index b5010cb..1cb0489 100644 --- a/src/routes/data/season/+page.svelte +++ b/src/routes/data/season/+page.svelte @@ -45,12 +45,16 @@ // All options to create a component for the teams const team_dropdown_options: DropdownOption[] = data.teams.map((team: Team) => { - return { label: team.name, value: team.id } as DropdownOption; + return { label: team.name, value: team.id, icon_url: team.logo_url } as DropdownOption; }); // All options to create a component for the drivers const driver_dropdown_options: DropdownOption[] = data.drivers.map((driver: Driver) => { - return { label: driver.code, value: driver.id } as DropdownOption; + return { + label: driver.code, + value: driver.id, + icon_url: driver.headshot_url, + } as DropdownOption; }); // All options to create a component for the races @@ -85,11 +89,6 @@
- - {#each data.teams as team} - - {/each} - {#if data.admin} {/if} + + + {#each data.teams as team} + + {/each}
{:else if current_tab === 1}
- - {#each data.drivers as driver} - - {/each} - {#if data.admin} {/if} + + + {#each data.drivers as driver} + + {/each}
{:else if current_tab === 2}
- {#each data.races as race} - - {/each} - {#if data.admin} {/if} + + {#each data.races as race} + + {/each}
{:else if current_tab === 3}
- {#each data.substitutions as substitution} - - {/each} - {#if data.admin} {/if} + + {#each data.substitutions as substitution} + + {/each}
{/if}