From dded5ba8543e02a47bffdec5c9335afcc3b093b0 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 16 Feb 2025 10:46:14 +0100 Subject: [PATCH] fix tables --- src/lib/components/ETFSidecard.svelte | 134 ++++++++++---------------- src/routes/+layout.svelte | 2 + 2 files changed, 54 insertions(+), 82 deletions(-) diff --git a/src/lib/components/ETFSidecard.svelte b/src/lib/components/ETFSidecard.svelte index 6c94e96b..af9bbb6a 100644 --- a/src/lib/components/ETFSidecard.svelte +++ b/src/lib/components/ETFSidecard.svelte @@ -8,6 +8,7 @@ } from "$lib/utils"; import { goto } from "$app/navigation"; + import HoverStockChart from "$lib/components/HoverStockChart.svelte"; export let data; @@ -62,7 +63,7 @@ website = info?.website; totalAssetPercentage = topHoldingList - ?.slice(0, 5) + ?.slice(0, 10) ?.reduce((acc, current) => acc + current?.weightPercentage, 0) ?.toFixed(2); } @@ -117,31 +118,24 @@
-

- Top Sectors +

+ Top Sectors

- +
- - + + - + {#each topSectorList as item} {#if item?.weightPercentage > 0} - - @@ -182,59 +176,44 @@
-

- Top Holdings +

+ Top 10 Holdings {totalAssetPercentage}% of assets

-
Sector
SectorWeight %Weight %
+ listItem?.title === item?.sector, @@ -152,7 +146,7 @@ + {abbreviateNumber(item?.weightPercentage?.toFixed(2))}%
- - - - - - - +
CompanyPortfolio
+ + + - {#each topHoldingList?.slice(0, 5) as item} + {#each topHoldingList?.slice(0, 10) as item} {#if item?.symbol !== null} stockSelector(item?.symbol)} - class="lg:shake-ticker sm:hover:text-white text-blue-400 cursor-pointer lg:hover:bg-[#245073] lg:hover:bg-opacity-[0.2] [#09090B] border-b border-[#27272A]" + class="cursor-pointer lg:hover:bg-[#245073] lg:hover:bg-opacity-[0.2] [#09090B] border-b border-[#27272A]" > - - + + @@ -248,7 +227,7 @@ href={`/etf/${$etfTicker}/holdings`} class="rounded cursor-pointer w-full m-auto py-2 h-full mt-6 text-[1rem] text-center font-semibold text-black sm:hover:hover:bg-gray-300 bg-[#ffff] transition duration-100" > - All Holdings + View More Holdings @@ -265,36 +244,27 @@
-

- Dividends +

+ Dividends Dividend Yield {dividendYield ?? "0"}%

-
NameSymbolWeight
-
-
- {item?.symbol ?? "n/a"} - - {#if typeof item?.name !== "undefined"} - {item?.name?.length > 20 - ? formatString(item?.name?.slice(0, 20)) + "..." - : formatString(item?.name)?.replace( - "Usd", - "USD", - )} - {:else} - n/a - {/if} - -
-
+
+ {#if typeof item?.name !== "undefined"} + {item?.name?.length > 20 + ? formatString(item?.name?.slice(0, 20)) + "..." + : formatString(item?.name)?.replace("Usd", "USD")} + {:else} + n/a + {/if} + + + {abbreviateNumber(item?.weightPercentage?.toFixed(2))}%
- - - - - - - +
Ex-DividendPayment DateAmount
+ + + {#each dividendHistoryList?.slice(0, 5) as item} - - + + - - {/each} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 832ee36c..91e39f80 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -799,6 +799,7 @@
Ex-DividendAmountPayment Date
+ {new Date(item?.date)?.toLocaleString("en-US", { month: "short", day: "numeric", @@ -303,7 +273,11 @@ })} + + ${item?.adjDividend?.toFixed(4)} + {item?.paymentDate?.length !== 0 ? new Date(item?.paymentDate)?.toLocaleString("en-US", { month: "short", @@ -313,10 +287,6 @@ }) : "n/a"} - ${item?.adjDividend?.toFixed(2)} -