This commit is contained in:
MuslemRahimi 2024-06-14 12:40:45 +02:00
parent 4fe3ab6678
commit d33fd58ecf
6 changed files with 15 additions and 12 deletions

View File

@ -166,7 +166,7 @@ $: {
<tbody>
{#each analytRatingList as item, index}
<tr on:click={() => goto(`/analysts/${item?.analystId}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] {index % 2 === 0 ? 'bg-opacity-[0.25] bg-[#323239]' : 'bg-[#0F0F0F]'} {index+1 === rawData?.length && data?.user?.tier !== 'Pro' ? 'opacity-[0.1]' : ''} border-b-[#0F0F0F] cursor-pointer">
<tr on:click={() => goto(`/analysts/${item?.analystId}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#202020] {index+1 === rawData?.length && data?.user?.tier !== 'Pro' ? 'opacity-[0.1]' : ''} cursor-pointer">
<td class="text-white text-[1rem] font-medium text-white text-end">
{item?.rank}
</td>
@ -202,13 +202,13 @@ $: {
</td>
<td class="text-end text-sm font-medium text-white">
<td class="text-end text-sm font-semibold text-white">
{#if Number(item?.successRate) >= 0}
<span class="text-[#37C97D]">{Number(item?.successRate)?.toFixed(2)}%</span>
{/if}
</td>
<td class="text-end text-sm font-medium text-white">
<td class="text-end text-sm font-semibold text-white">
{#if Number(item?.avgReturn) >= 0}
<span class="text-[#37C97D]">{Number(item?.avgReturn)?.toFixed(2)}%</span>
{:else}
@ -216,7 +216,7 @@ $: {
{/if}
</td>
<td class="text-end font-medium text-white text-sm">
<td class="text-end font-semibold text-white text-sm">
{item?.totalRatings}
</td>

View File

@ -251,7 +251,7 @@ function sectorSelector(sector) {
<tbody>
{#each ratingsList as item, index}
<tr on:click={() => goto(`/stocks/${item?.ticker}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] {index % 2 === 0 ? 'bg-opacity-[0.25] bg-[#323239]' : 'bg-[#0F0F0F]'} border-b-[#0F0F0F] cursor-pointer">
<tr on:click={() => goto(`/stocks/${item?.ticker}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#202020] cursor-pointer">
<td class="text-sm text-start">
<div class="flex flex-col items-start w-20 sm:w-fit">

View File

@ -178,7 +178,7 @@
<tbody>
{#each analytRatingList as item, index}
<tr on:click={() => goto(`/stocks/${item?.ticker}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] {index % 2 === 0 ? 'bg-opacity-[0.25] bg-[#323239]' : 'bg-[#0F0F0F]'} {index+1 === rawData?.length && data?.user?.tier !== 'Pro' ? 'opacity-[0.1]' : ''} border-b-[#0F0F0F] cursor-pointer">
<tr on:click={() => goto(`/stocks/${item?.ticker}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#202020] {index+1 === rawData?.length && data?.user?.tier !== 'Pro' ? 'opacity-[0.1]' : ''} cursor-pointer">
<td class="text-white text-sm font-medium text-white text-end">
{item?.rank}
</td>

View File

@ -351,7 +351,7 @@ $: {
</thead>
<tbody>
{#each gainerLoserActive as item, index}
<tr on:click={() => goto("/stocks/"+item?.symbol)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] {index % 2 === 0 ? 'bg-opacity-[0.25] bg-[#323239]' : 'bg-[#0F0F0F]'} border-b-[#0F0F0F] cursor-pointer">
<tr on:click={() => goto("/stocks/"+item?.symbol)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#202020] cursor-pointer">
<td class="border-b-[#0F0F0F]">
<div class="flex flex-col">
@ -380,7 +380,7 @@ $: {
<div class="flex flex-row justify-end items-center">
<div class="flex flex-col items-center">
<span class="text-white font-bold text-md ml-auto">${item.price?.toFixed(2)}</span>
<span class="text-white font-medium text-md ml-auto">${item.price?.toFixed(2)}</span>
<div class="flex flex-row mt-1">
{#if item?.changesPercentage >=0}
<svg class="w-5 h-5 -mr-0.5 -mt-0.5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g id="evaArrowUpFill0"><g id="evaArrowUpFill1"><path id="evaArrowUpFill2" fill="#10db06" d="M16.21 16H7.79a1.76 1.76 0 0 1-1.59-1a2.1 2.1 0 0 1 .26-2.21l4.21-5.1a1.76 1.76 0 0 1 2.66 0l4.21 5.1A2.1 2.1 0 0 1 17.8 15a1.76 1.76 0 0 1-1.59 1Z"/></g></g></svg>

View File

@ -4,7 +4,8 @@
import InfiniteLoading from '$lib/components/InfiniteLoading.svelte';
import { abbreviateNumber } from '$lib/utils.js';
import { onMount } from 'svelte';
import UpgradeToPro from '$lib/components/UpgradeToPro.svelte';
export let data;
let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL;
@ -96,7 +97,7 @@
<div>
<div class="flex flex-row justify-center items-center">
<h1 class="text-3xl sm:text-4xl text-white text-center font-bold mb-5">
Most Shorted Stocks
Shorted Stocks
</h1>
</div>
@ -171,7 +172,7 @@
<tbody>
{#each shortedList as item, index}
<tr on:click={() => goto(`/stocks/${item?.symbol}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] {index % 2 === 0 ? 'bg-[#202020]' : 'bg-[#0F0F0F]'} border-b-[#0F0F0F] cursor-pointer">
<tr on:click={() => goto(`/stocks/${item?.symbol}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#202020] {index+1 === shortedList?.length && data?.user?.tier !== 'Pro' ? 'opacity-[0.1]' : ''} cursor-pointer">
<td class="text-white text-sm font-medium text-white text-end">
{index+1}
</td>
@ -213,7 +214,7 @@
</table>
</div>
<InfiniteLoading on:infinite={infiniteHandler} />
<UpgradeToPro data={data} title="Get the most shorted stocks on the market to never miss out the next short squeeze"/>
</div>

View File

@ -34,6 +34,8 @@ export const load = async ({parent}) => {
output = await response.json();
output = data?.user?.tier !== 'Pro' ? output?.slice(0,6) : output;
setCache('', output, 'getMostShortedStocks');
}