From e98252ad008577179267724c7e8c43a87d8dded5 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sat, 21 Sep 2024 17:20:52 +0200 Subject: [PATCH] add more hrefs for faster loading --- src/lib/components/IndustryTable.svelte | 22 +++++--------------- src/routes/industry/+page.svelte | 18 +++++----------- src/routes/industry/all/+page.svelte | 11 +++++----- src/routes/industry/sectors/+page.svelte | 19 +++++------------ src/routes/list/industry/[slug]/+page.svelte | 8 ++++--- 5 files changed, 26 insertions(+), 52 deletions(-) diff --git a/src/lib/components/IndustryTable.svelte b/src/lib/components/IndustryTable.svelte index b3b34c29..86bb7476 100644 --- a/src/lib/components/IndustryTable.svelte +++ b/src/lib/components/IndustryTable.svelte @@ -1,21 +1,8 @@ @@ -38,12 +25,13 @@ function formatFilename(industryName) { {#each industryList as item} - formatFilename(item?.industry)} class="cursor-pointer sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#27272A] border-b-[#09090B]"> - - {item?.industry?.length > charNumber ? item?.industry?.slice(0,charNumber) + "..." : item?.industry} + + + + {item?.industry?.length > charNumber ? item?.industry?.slice(0,charNumber) + "..." : item?.industry} + - {item?.numStocks} diff --git a/src/routes/industry/+page.svelte b/src/routes/industry/+page.svelte index e9eafaa2..90d0ab8c 100644 --- a/src/routes/industry/+page.svelte +++ b/src/routes/industry/+page.svelte @@ -58,16 +58,6 @@ const sectorNavigation = [ }, ] -function sectorSelector(sector) { - const selectedSector = sectorNavigation?.find(item => item?.title === sector); - - if (selectedSector) { - goto(selectedSector?.link); - } else { - // Handle the case when the sector is not found - console.error(`Sector not found: ${sector}`); - } - } @@ -93,11 +83,13 @@ $: charNumber = $screenWidth < 640 ? 20 : 30;
{#each sectorList as sector} -

sectorSelector(sector)} class="cursor-pointer text-white sm:hover:underline font-semibold text-lg sm:text-xl mt-5"> +

+ +
-
+
diff --git a/src/routes/industry/all/+page.svelte b/src/routes/industry/all/+page.svelte index 30b1ad7e..ae81dcb3 100644 --- a/src/routes/industry/all/+page.svelte +++ b/src/routes/industry/all/+page.svelte @@ -1,7 +1,6 @@