bugfixing

This commit is contained in:
MuslemRahimi 2024-10-31 16:19:04 +01:00
parent b80a99efc0
commit 811627f30d

View File

@ -2,6 +2,7 @@
import { import {
numberOfUnreadNotification, numberOfUnreadNotification,
displayCompanyName, displayCompanyName,
screenWidth,
stockTicker, stockTicker,
} from "$lib/store"; } from "$lib/store";
import InfoModal from "$lib/components/InfoModal.svelte"; import InfoModal from "$lib/components/InfoModal.svelte";
@ -36,8 +37,8 @@
if (Object?.keys(analystRating)?.length !== 0) { if (Object?.keys(analystRating)?.length !== 0) {
numOfAnalyst = analystRating?.numOfAnalyst; numOfAnalyst = analystRating?.numOfAnalyst;
priceTarget = priceTarget =
analystRating?.priceTarget !== ("n/a" && 0) analystRating?.medianPriceTarget !== ("n/a" && 0)
? analystRating?.priceTarget ? analystRating?.medianPriceTarget
: "-"; : "-";
consensusRating = analystRating?.consensusRating; consensusRating = analystRating?.consensusRating;
changesPercentage = changesPercentage =
@ -93,6 +94,8 @@
window.removeEventListener("scroll", handleScroll); window.removeEventListener("scroll", handleScroll);
}; };
}); });
$: charNumber = $screenWidth < 640 ? 20 : 30;
</script> </script>
<svelte:head> <svelte:head>
@ -251,8 +254,18 @@
>Analyst</td >Analyst</td
> >
<td class="text-white font-semibold text-[1rem] text-start" <td class="text-white font-semibold text-[1rem] text-start"
>Firm</td
>
<td class="text-white font-semibold text-[1rem] text-end"
>Rating</td >Rating</td
> >
<td class="text-white font-semibold text-[1rem] text-end"
>Action</td
>
<td class="text-white font-semibold text-[1rem] text-end"
>Price Target</td
>
<td class="text-white font-semibold text-[1rem] text-end" <td class="text-white font-semibold text-[1rem] text-end"
>Date</td >Date</td
> >
@ -280,11 +293,6 @@
class="sm:hover:text-white text-blue-400" class="sm:hover:text-white text-blue-400"
>{item?.analyst_name} >{item?.analyst_name}
</a> </a>
<span class="text-white"
>{item?.analyst?.length > 15
? item?.analyst?.slice(0, 15) + "..."
: item?.analyst}</span
>
<div class="flex flex-row items-center mt-1"> <div class="flex flex-row items-center mt-1">
{#each Array.from({ length: 5 }) as _, i} {#each Array.from({ length: 5 }) as _, i}
@ -325,9 +333,16 @@
</td> </td>
<td <td
class="text-sm sm:text-[1rem] whitespace-nowrap text-center text-white" class="text-sm sm:text-[1rem] whitespace-nowrap text-start text-white"
>
{item?.analyst?.length > charNumber
? item?.analyst?.slice(0, charNumber) + "..."
: item?.analyst}
</td>
<td
class="text-sm sm:text-[1rem] whitespace-nowrap text-end text-white"
> >
<div class="flex flex-col items-start">
<span <span
class="text-[1rem] font-medium {[ class="text-[1rem] font-medium {[
'Strong Buy', 'Strong Buy',
@ -344,12 +359,21 @@
> >
{item?.rating_current} {item?.rating_current}
</span> </span>
<span class="font-medium text-white" </td>
>{item?.action_company?.replace(
<td
class="text-sm sm:text-[1rem] whitespace-nowrap text-end text-white"
>
{item?.action_company?.replace(
"Initiates Coverage On", "Initiates Coverage On",
"Initiates", "Initiates",
)}</span )}
</td>
<td
class="text-sm sm:text-[1rem] whitespace-nowrap text-end text-white"
> >
<div class="flex flex-col items-end">
<div class="flex flex-row items-center"> <div class="flex flex-row items-center">
{#if Math?.ceil(item?.adjusted_pt_prior) !== 0} {#if Math?.ceil(item?.adjusted_pt_prior) !== 0}
<span class="text-gray-100 font-normal" <span class="text-gray-100 font-normal"