update price reaction page

This commit is contained in:
MuslemRahimi 2025-01-13 12:12:37 +01:00
parent 3eef3c03e7
commit 82e8b82472
2 changed files with 10 additions and 3 deletions

View File

@ -1,5 +1,5 @@
export const load = async ({ locals, params }) => { export const load = async ({ locals, params }) => {
const { apiKey, apiURL } = locals; const { apiKey, apiURL, user } = locals;
const getData = async () => { const getData = async () => {
const postData = { const postData = {
@ -16,7 +16,8 @@ export const load = async ({ locals, params }) => {
body: JSON.stringify(postData), body: JSON.stringify(postData),
}); });
const output = await response.json(); let output = await response.json();
output = user?.tier !== 'Pro' ? output?.slice(0,3) : output;
return output; return output;
}; };

View File

@ -4,6 +4,7 @@
displayCompanyName, displayCompanyName,
stockTicker, stockTicker,
} from "$lib/store"; } from "$lib/store";
import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
import Infobox from "$lib/components/Infobox.svelte"; import Infobox from "$lib/components/Infobox.svelte";
export let data; export let data;
@ -245,7 +246,11 @@
></td ></td
></tr ></tr
> >
<tr class="group" <tr
class="group {index + 1 === rawData?.length &&
data?.user?.tier !== 'Pro'
? 'opacity-[0.1]'
: ''}"
><td ><td
class="border-l border-primary pl-1 text-[#c3c6d0] text-sm px-1" class="border-l border-primary pl-1 text-[#c3c6d0] text-sm px-1"
><div class="flex w-full justify-between"> ><div class="flex w-full justify-between">
@ -408,6 +413,7 @@
> >
</table> </table>
</div> </div>
<UpgradeToPro {data} />
{:else} {:else}
<Infobox text="No data available" /> <Infobox text="No data available" />
{/if} {/if}