From a1885f38fbfbf9083bfb57d1ea16cceaff54549a Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 28 Jul 2024 19:43:41 +0200 Subject: [PATCH] update reddit tracker --- src/routes/reddit-tracker/+page.svelte | 44 ++++++++++++++++++++------ 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/src/routes/reddit-tracker/+page.svelte b/src/routes/reddit-tracker/+page.svelte index 50e9b642..1e31b121 100644 --- a/src/routes/reddit-tracker/+page.svelte +++ b/src/routes/reddit-tracker/+page.svelte @@ -387,8 +387,8 @@ const optionCompanySpread = { -
- +
+
@@ -399,13 +399,17 @@ const optionCompanySpread = { {#each data?.getRedditTracker?.posts as item}
- + {#if item?.selftext?.length !== 0} -
- {item?.selftext?.length < 400 ? removeHttpsStrings(item?.selftext) : removeHttpsStrings(item?.selftext)?.slice(0,240) +'...'} +
+ {#if $screenWidth < 640} + {item?.selftext?.length > 400 ? removeHttpsStrings(item?.selftext)?.slice(0,240)+ '...' : removeHttpsStrings(item?.selftext)} + {:else} + {item?.selftext?.length > 1000 ? removeHttpsStrings(item?.selftext)?.slice(0,800)+ '...' : removeHttpsStrings(item?.selftext)} + {/if}
{/if} @@ -424,10 +428,10 @@ const optionCompanySpread = {
- + Posted by {item?.author} - + {formatUtcTimestamp(item?.created_utc)} @@ -438,7 +442,7 @@ const optionCompanySpread = { {/each} - + @@ -456,6 +460,7 @@ const optionCompanySpread = { Calls Puts Sentiment + Price @@ -465,12 +470,31 @@ const optionCompanySpread = { {index+1} - {item?.symbol} + +
+ {item?.symbol} + +
+
{item?.count} {item?.call} {item?.put} {item?.avgSentiment > 0.4 ? 'Bullish' : item?.avgSentiment <= -0.1 ? 'Bearish' : 'Neutral'} + +
+ +
+ ${item.price?.toFixed(2)} + {item?.changesPercentage?.toFixed(2)}% + +
+ + +
+
{/each}