This commit is contained in:
MuslemRahimi 2025-01-03 16:43:13 +01:00
parent 6f1e871fec
commit 91515ddbc1
4 changed files with 14 additions and 7 deletions

View File

@ -5,6 +5,7 @@
import { abbreviateNumberWithColor } from "$lib/utils"; import { abbreviateNumberWithColor } from "$lib/utils";
export let data;
export let rawData = []; export let rawData = [];
let stockList = []; let stockList = [];
@ -162,7 +163,11 @@
<tbody> <tbody>
{#each stockList as item, index} {#each stockList as item, index}
<tr <tr
class="sm:hover:bg-[#245073] border-b border-gray-800 sm:hover:bg-opacity-[0.2] odd:bg-odd" class="sm:hover:bg-[#245073] border-b border-gray-800 sm:hover:bg-opacity-[0.2] odd:bg-odd {index +
1 ===
rawData?.length && data?.user?.tier !== 'Pro'
? 'opacity-[0.1]'
: ''}"
> >
<td <td
class="text-start text-sm sm:text-[1rem] whitespace-nowrap text-white" class="text-start text-sm sm:text-[1rem] whitespace-nowrap text-white"

View File

@ -11,7 +11,7 @@ export const load = async ({ locals }) => {
}, },
}); });
let output = await response.json(); let output = await response.json();
output = user?.tier !== "Pro" ? output?.slice(0, 6) : output; output = user?.tier !== "Pro" ? output?.slice(0,6) : output;
return output; return output;
}; };

View File

@ -4,7 +4,7 @@ import { loginUserSchema, registerUserSchema } from "$lib/schemas";
export const load = async ({ params, locals }) => { export const load = async ({ params, locals }) => {
const { apiURL, apiKey } = locals; const { apiURL, apiKey, user } = locals;
const postData = { const postData = {
ticker: params.tickerID, ticker: params.tickerID,
@ -22,7 +22,9 @@ export const load = async ({ params, locals }) => {
body: JSON.stringify(postData), body: JSON.stringify(postData),
}); });
const output = await response.json(); let output = await response.json();
output.hottestTrades = user?.tier !== "Pro" ? output?.hottestTrades?.slice(0, 3) : output.hottestTrades;
return output; return output;
}; };

View File

@ -95,10 +95,10 @@
metrics={data?.getPriceLevel?.metrics} metrics={data?.getPriceLevel?.metrics}
/> />
{/if} {/if}
{#if data?.user?.tier === "Pro"}
{#if hottestTrades?.length > 0} {#if hottestTrades?.length > 0}
<HottestTrades rawData={hottestTrades} /> <HottestTrades {data} rawData={hottestTrades} />
{/if} {/if}
{#if data?.user?.tier === "Pro"}
{#if historicalDarkPool?.length > 10} {#if historicalDarkPool?.length > 10}
<HistoricalVolume rawData={historicalDarkPool} /> <HistoricalVolume rawData={historicalDarkPool} />
{/if} {/if}