From a80a1a3ff8b1b32c9474038cc6bffdfad9f5b8fc Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 30 Jan 2025 15:17:01 +0100 Subject: [PATCH] ui fixes --- src/lib/components/NextEarnings.svelte | 69 ++++++--- src/routes/+page.svelte | 198 ++++++++++++++++++------- 2 files changed, 190 insertions(+), 77 deletions(-) diff --git a/src/lib/components/NextEarnings.svelte b/src/lib/components/NextEarnings.svelte index 3998c5fc..c7ddf1df 100644 --- a/src/lib/components/NextEarnings.svelte +++ b/src/lib/components/NextEarnings.svelte @@ -68,32 +68,53 @@ during market hours. {/if}
Analysts project revenue of - {@html abbreviateNumber(rawData?.revenueEst, true, true)}, reflecting a - {revenueRatio !== "Infinity" - ? abbreviateNumber(revenueRatio) + "%" - : "n/a"} - YoY {revenueRatio > 0 ? "growth" : revenueRatio < 0 ? "shrinking" : ""} - {#if epsRatio !== null} - and earnings per share of - {rawData?.epsEst}, making a - {epsRatio}%Pro Subscription - {epsRatio > 0 ? "increase" : epsRatio < 0 ? "decrease" : ""} YoY. {:else} - and earnings per share of - {rawData?.epsEst}. + {@html abbreviateNumber(rawData?.revenueEst, true, true)}, reflecting a + {revenueRatio !== "Infinity" + ? abbreviateNumber(revenueRatio) + "%" + : "n/a"} + YoY {revenueRatio > 0 + ? "growth" + : revenueRatio < 0 + ? "shrinking" + : ""} + {#if epsRatio !== null} + and earnings per share of + {rawData?.epsEst}, making a + {epsRatio}% + {epsRatio > 0 ? "increase" : epsRatio < 0 ? "decrease" : ""} YoY. + {:else} + and earnings per share of + {rawData?.epsEst}. + {/if} {/if} diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 0d5c9203..eadfd0b7 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -387,19 +387,55 @@ {#if recentWIIM?.length !== 0} {:else} @@ -648,48 +684,104 @@ {#if data?.getDashboard?.upcomingEarnings?.length !== 0}
    - {#each data?.getDashboard?.upcomingEarnings as item} -
  • - {item?.name} () - {item?.isToday === true - ? "will report today" - : [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - ].includes( - new Date().toLocaleDateString("en-US", { - weekday: "long", - }), - ) - ? "will report tomorrow" - : "will report monday"} - {#if item?.time} - {#if compareTimes(item?.time, "16:00") >= 0} - after market closes. - {:else if compareTimes(item?.time, "09:30") <= 0} - before market opens. - {:else} - during market. + {#each data?.getDashboard?.upcomingEarnings as item, index} + {#if index >= 3 && data?.user?.tier !== "Pro"} +
  • + {item?.name} () + {item?.isToday === true + ? "will report today" + : [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + ].includes( + new Date().toLocaleDateString("en-US", { + weekday: "long", + }), + ) + ? "will report tomorrow" + : "will report monday"} + {#if item?.time} + {#if compareTimes(item?.time, "16:00") >= 0} + after market closes. + {:else if compareTimes(item?.time, "09:30") <= 0} + before market opens. + {:else} + during market. + {/if} + {/if}Analysts estimate ... + + + + + + + + Upgrade + + +
  • + {:else} +
  • + {item?.name} () + {item?.isToday === true + ? "will report today" + : [ + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + ].includes( + new Date().toLocaleDateString("en-US", { + weekday: "long", + }), + ) + ? "will report tomorrow" + : "will report monday"} + {#if item?.time} + {#if compareTimes(item?.time, "16:00") >= 0} + after market closes. + {:else if compareTimes(item?.time, "09:30") <= 0} + before market opens. + {:else} + during market. + {/if} + {/if}Analysts estimate {abbreviateNumber( + item?.revenueEst, + )} in revenue ({( + (item?.revenueEst / item?.revenuePrior - 1) * + 100 + )?.toFixed(2)}% YoY) and {item?.epsEst} in earnings per share + {#if item?.epsPrior !== 0} + ({( + (item?.epsEst / item?.epsPrior - 1) * + 100 + )?.toFixed(2)}% YoY). {/if} - {/if}Analysts estimate {abbreviateNumber( - item?.revenueEst, - )} in revenue ({( - (item?.revenueEst / item?.revenuePrior - 1) * - 100 - )?.toFixed(2)}% YoY) and {item?.epsEst} in earnings per share - {#if item?.epsPrior !== 0} - ({((item?.epsEst / item?.epsPrior - 1) * 100)?.toFixed( - 2, - )}% YoY). - {/if} -
  • + + {/if} {/each}
{:else}