From d33fd58ecf153ea7c258df9a4d1b7e738de64075 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Fri, 14 Jun 2024 12:40:45 +0200 Subject: [PATCH] ui fixes --- src/routes/analysts/+page.svelte | 8 ++++---- src/routes/analysts/[slug]/+page.svelte | 2 +- src/routes/analysts/top-stocks/+page.svelte | 2 +- src/routes/market-mover/+page.svelte | 4 ++-- src/routes/most-shorted-stocks/+page.svelte | 9 +++++---- src/routes/most-shorted-stocks/+page.ts | 2 ++ 6 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/routes/analysts/+page.svelte b/src/routes/analysts/+page.svelte index 0b180865..729f53d9 100644 --- a/src/routes/analysts/+page.svelte +++ b/src/routes/analysts/+page.svelte @@ -166,7 +166,7 @@ $: { {#each analytRatingList as item, index} - 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"> + 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"> {item?.rank} @@ -202,13 +202,13 @@ $: { - + {#if Number(item?.successRate) >= 0} {Number(item?.successRate)?.toFixed(2)}% {/if} - + {#if Number(item?.avgReturn) >= 0} {Number(item?.avgReturn)?.toFixed(2)}% {:else} @@ -216,7 +216,7 @@ $: { {/if} - + {item?.totalRatings} diff --git a/src/routes/analysts/[slug]/+page.svelte b/src/routes/analysts/[slug]/+page.svelte index 621928e0..cd56dc7c 100644 --- a/src/routes/analysts/[slug]/+page.svelte +++ b/src/routes/analysts/[slug]/+page.svelte @@ -251,7 +251,7 @@ function sectorSelector(sector) { {#each ratingsList as item, index} - 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"> + goto(`/stocks/${item?.ticker}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#202020] cursor-pointer">
diff --git a/src/routes/analysts/top-stocks/+page.svelte b/src/routes/analysts/top-stocks/+page.svelte index e4f68a26..c429d961 100644 --- a/src/routes/analysts/top-stocks/+page.svelte +++ b/src/routes/analysts/top-stocks/+page.svelte @@ -178,7 +178,7 @@ {#each analytRatingList as item, index} - 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"> + 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"> {item?.rank} diff --git a/src/routes/market-mover/+page.svelte b/src/routes/market-mover/+page.svelte index 26e2f838..a530b321 100644 --- a/src/routes/market-mover/+page.svelte +++ b/src/routes/market-mover/+page.svelte @@ -351,7 +351,7 @@ $: { {#each gainerLoserActive as item, index} - 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"> + goto("/stocks/"+item?.symbol)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#202020] cursor-pointer">
@@ -380,7 +380,7 @@ $: {
- ${item.price?.toFixed(2)} + ${item.price?.toFixed(2)}
{#if item?.changesPercentage >=0} diff --git a/src/routes/most-shorted-stocks/+page.svelte b/src/routes/most-shorted-stocks/+page.svelte index 6e52339c..2bac74b3 100644 --- a/src/routes/most-shorted-stocks/+page.svelte +++ b/src/routes/most-shorted-stocks/+page.svelte @@ -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 @@

- Most Shorted Stocks + Shorted Stocks

@@ -171,7 +172,7 @@ {#each shortedList as item, index} - 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"> + 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"> {index+1} @@ -213,7 +214,7 @@
- +
diff --git a/src/routes/most-shorted-stocks/+page.ts b/src/routes/most-shorted-stocks/+page.ts index 05e0afac..825a06e3 100644 --- a/src/routes/most-shorted-stocks/+page.ts +++ b/src/routes/most-shorted-stocks/+page.ts @@ -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'); }