From 827732223f4b3fb2fb0769e68eada6dd1a8a94ac Mon Sep 17 00:00:00 2001 From: pml68 Date: Tue, 27 Feb 2024 18:42:16 +0100 Subject: fix: icons not displaying in build --- src/routes/+page.svelte | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/routes') diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index c6d0eb7..6c403ee 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -9,15 +9,17 @@ import TelegramIcon from '$lib/assets/telegram.svg?src' import EnvelopeIcon from '$lib/assets/envelope.svg?src' + const icons: string[] = [SteamIcon, GithubIcon, DevIcon, TelegramIcon, EnvelopeIcon] + type Social = { link: string, - icon: string + iconIndex: number } const socialsList: Social[] = socials - const insertIcon: Function = (element: HTMLElement, icon: string) => { - element.innerHTML = eval(`${icon}Icon`) + const insertIcon: Function = (element: HTMLElement, iconIndex: string) => { + element.innerHTML = icons[iconIndex] } @@ -29,8 +31,8 @@

pml68

Just your average IT student

- {#each socialsList as {link, icon}} - + {#each socialsList as {link, iconIndex}} + {/each}
-- cgit v1.2.3