From 811627f30d11e35dc8edce609c08e2a2a1438f96 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Thu, 31 Oct 2024 16:19:04 +0100 Subject: [PATCH] bugfixing --- .../[tickerID]/forecast/analyst/+page.svelte | 86 ++++++++++++------- 1 file changed, 55 insertions(+), 31 deletions(-) diff --git a/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte b/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte index 02678120..c0d43644 100644 --- a/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte +++ b/src/routes/stocks/[tickerID]/forecast/analyst/+page.svelte @@ -2,6 +2,7 @@ import { numberOfUnreadNotification, displayCompanyName, + screenWidth, stockTicker, } from "$lib/store"; import InfoModal from "$lib/components/InfoModal.svelte"; @@ -36,8 +37,8 @@ if (Object?.keys(analystRating)?.length !== 0) { numOfAnalyst = analystRating?.numOfAnalyst; priceTarget = - analystRating?.priceTarget !== ("n/a" && 0) - ? analystRating?.priceTarget + analystRating?.medianPriceTarget !== ("n/a" && 0) + ? analystRating?.medianPriceTarget : "-"; consensusRating = analystRating?.consensusRating; changesPercentage = @@ -93,6 +94,8 @@ window.removeEventListener("scroll", handleScroll); }; }); + + $: charNumber = $screenWidth < 640 ? 20 : 30; @@ -251,8 +254,18 @@ >Analyst Firm + Rating + Action + Price Target + Date @@ -280,11 +293,6 @@ class="sm:hover:text-white text-blue-400" >{item?.analyst_name} - {item?.analyst?.length > 15 - ? item?.analyst?.slice(0, 15) + "..." - : item?.analyst}
{#each Array.from({ length: 5 }) as _, i} @@ -325,31 +333,47 @@ -
- - {item?.rating_current} - - {item?.action_company?.replace( - "Initiates Coverage On", - "Initiates", - )} + {item?.analyst?.length > charNumber + ? item?.analyst?.slice(0, charNumber) + "..." + : item?.analyst} + + + + + {item?.rating_current} + + + + + {item?.action_company?.replace( + "Initiates Coverage On", + "Initiates", + )} + + + +
{#if Math?.ceil(item?.adjusted_pt_prior) !== 0}