From 85ba1761eca2e9eccf63e55b38ed1ef313c3b614 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 1 Dec 2024 18:54:35 +0100 Subject: [PATCH] ui fix --- .../stocks/[tickerID]/financials/+page.svelte | 589 +++++++++--------- 1 file changed, 297 insertions(+), 292 deletions(-) diff --git a/src/routes/stocks/[tickerID]/financials/+page.svelte b/src/routes/stocks/[tickerID]/financials/+page.svelte index 3abb169f..f68e8755 100644 --- a/src/routes/stocks/[tickerID]/financials/+page.svelte +++ b/src/routes/stocks/[tickerID]/financials/+page.svelte @@ -423,329 +423,334 @@ (item) => item?.propertyName === displayStatement, )?.text} - {:else} + {:else if income?.length > 0} Get detailed income statement breakdowns, uncovering revenue, expenses, and much more. + {:else} + No financial data available for {$displayCompanyName} {/if} - -
+ {#if income?.length > 0}
- {#each tabs as item, i} - - {/each} -
-
- -
- + class="bg-[#313131] w-full min-w-24 sm:w-fit relative flex flex-wrap items-center justify-center rounded-md p-1 mt-4" + > + {#each tabs as item, i} + + {/each} +
+
-
- - - - - - - Select time frame - - - - (timeFrame = "5Y")} - class="cursor-pointer hover:bg-[#27272A]" - > - 5 years - - (timeFrame = "10Y")} - class="cursor-pointer hover:bg-[#27272A]" - > - 10 years - - (timeFrame = "MAX")} - class="cursor-pointer hover:bg-[#27272A]" - > - Max - - - - -
- -
- + +
+ {#if $coolMode} + + Cool Mode + + {:else} + + Boring Mode + + {/if} + - {#if $coolMode} -
-
- +
-
- -
+ {#if $coolMode} +
+
+ +
+
-

- {statementConfig?.find( - (item) => item?.propertyName === displayStatement, - )?.label} History -

+
+ +
-
- - - - - - - - - - - {#each tableList as item, index} - - - +
{filterRule === "annual" - ? "Fiscal Year End" - : "Quarter Ends"}{statementConfig?.find( - (item) => item?.propertyName === displayStatement, - )?.label}ChangeGrowth
+ {statementConfig?.find( + (item) => item?.propertyName === displayStatement, + )?.label} History + + +
+ + + + - {item?.date} - - - - - - - - {/each} - -
{filterRule === "annual" + ? "Fiscal Year End" + : "Quarter Ends"}{statementConfig?.find( + (item) => item?.propertyName === displayStatement, + )?.label} - {abbreviateNumber(item?.value)} - Change - {item?.value - tableList[index + 1]?.value !== 0 - ? abbreviateNumber( - ( - item?.value - tableList[index + 1]?.value - )?.toFixed(2), - ) - : "-"} - Growth - {#if index + 1 - tableList?.length === 0} - - - {:else if item?.value === 0 && tableList[index + 1]?.value < 0} - -100.00% - {:else if item?.value === 0 && tableList[index + 1]?.value > 0} - 100.00% - {:else if item?.value - tableList[index + 1]?.value > 0} - - {( - ((item?.value - tableList[index + 1]?.value) / - Math.abs(item?.value)) * - 100 - )?.toFixed(2)}% - - {:else if item?.value - tableList[index + 1]?.value < 0} - - -{( - Math?.abs( - (tableList[index + 1]?.value - - item?.value) / - Math.abs(item?.value), - ) * 100 - )?.toFixed(2)}% - - {:else} - - - {/if} -
-
- {:else} -
- - - - - {#each income as cash} - {#if filterRule === "annual"} + + + {#each tableList as item, index} + + - {:else} + - {/if} + + + + + {/each} - - - - - - -
Year
- {"FY" + cash?.calendarYear?.slice(-2)} + {item?.date} - {"FY" + - cash?.calendarYear?.slice(-2) + - " " + - cash?.period} + {abbreviateNumber(item?.value)} + {item?.value - tableList[index + 1]?.value !== 0 + ? abbreviateNumber( + ( + item?.value - tableList[index + 1]?.value + )?.toFixed(2), + ) + : "-"} + + {#if index + 1 - tableList?.length === 0} + - + {:else if item?.value === 0 && tableList[index + 1]?.value < 0} + -100.00% + {:else if item?.value === 0 && tableList[index + 1]?.value > 0} + 100.00% + {:else if item?.value - tableList[index + 1]?.value > 0} + + {( + ((item?.value - + tableList[index + 1]?.value) / + Math.abs(item?.value)) * + 100 + )?.toFixed(2)}% + + {:else if item?.value - tableList[index + 1]?.value < 0} + + -{( + Math?.abs( + (tableList[index + 1]?.value - + item?.value) / + Math.abs(item?.value), + ) * 100 + )?.toFixed(2)}% + + {:else} + - + {/if} +
-
+
+
+ {:else} +
+ + + + + {#each income as cash} + {#if filterRule === "annual"} + + {:else} + + {/if} + {/each} + + + + + + +
Year + {"FY" + cash?.calendarYear?.slice(-2)} + + {"FY" + + cash?.calendarYear?.slice(-2) + + " " + + cash?.period} +
+
+ {/if} {/if}