From 12f52be6ffc839d50faed48d5a63bddcd1bfb7f2 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 17 Nov 2024 13:39:12 +0100 Subject: [PATCH] refactor etf page --- src/lib/components/ETFKeyInformation.svelte | 176 -- src/lib/components/ETFSidecard.svelte | 305 ++++ src/lib/components/News.svelte | 4 +- src/routes/etf/+page.svelte | 1 - src/routes/etf/[tickerID]/+layout.server.ts | 20 +- src/routes/etf/[tickerID]/+layout.svelte | 664 ++------ src/routes/etf/[tickerID]/+layout.ts | 14 +- src/routes/etf/[tickerID]/+page.server.ts | 7 +- src/routes/etf/[tickerID]/+page.svelte | 1674 ++++++++++--------- src/routes/stocks/[tickerID]/+page.svelte | 32 +- 10 files changed, 1355 insertions(+), 1542 deletions(-) delete mode 100644 src/lib/components/ETFKeyInformation.svelte create mode 100644 src/lib/components/ETFSidecard.svelte diff --git a/src/lib/components/ETFKeyInformation.svelte b/src/lib/components/ETFKeyInformation.svelte deleted file mode 100644 index 7f181a11..00000000 --- a/src/lib/components/ETFKeyInformation.svelte +++ /dev/null @@ -1,176 +0,0 @@ - - - -
- - -
- - - - - - - -
- - -
- - - - - -
- -
- - -
- - - - -
- - - - -
- -
-
-
- - - - -
- -
- - -
- - - - -
- -
- -
-
-
- - - - -
- -
- - -
- - - - -
-

- Top Holdings -

-
- - Discover the primary holdings within the ETF's composition. - - -
-
- -
- -
- - - -
- - - - -
- -
-
-
- - - - -
- -
- - -
- - - - -
- - - - -
- -
-
-
- \ No newline at end of file diff --git a/src/lib/components/ETFSidecard.svelte b/src/lib/components/ETFSidecard.svelte new file mode 100644 index 00000000..5e6bd8a2 --- /dev/null +++ b/src/lib/components/ETFSidecard.svelte @@ -0,0 +1,305 @@ + + +
+

+ About {$etfTicker} +

+

+ {#if showFullText} + {description} + {:else} + {snippet} + {/if} +

+ {#if description.length !== 0} +
+ +
+ {/if} + +
+
+ Asset Class + {assetClass} +
+
+ Ticker Symbol + {$etfTicker} +
+
+ Inception Date + {ipoDate} +
+
+ Provider + {formatETFName(provider)} +
+ +
+ Website + Fund Home Page +
+
+
+ +{#if topHoldingList?.length !== 0} + +{/if} + +{#if dividendHistoryList?.length !== 0} + +{/if} diff --git a/src/lib/components/News.svelte b/src/lib/components/News.svelte index a533807f..a57ddf51 100644 --- a/src/lib/components/News.svelte +++ b/src/lib/components/News.svelte @@ -1,5 +1,5 @@ + + -
+
@@ -391,10 +321,7 @@
- +
{#if $currentPortfolioPrice !== null && $currentPortfolioPrice !== 0} - {$etfTicker?.includes(".DE") || - $etfTicker?.includes(".F") - ? `${$currentPortfolioPrice}鈧琡 - : ` $${$currentPortfolioPrice}`} + {$currentPortfolioPrice} {:else} - --- + {data?.getStockQuote?.price} {/if}
@@ -452,9 +376,7 @@