update congress page
This commit is contained in:
parent
e58b35025b
commit
adb81a1133
@ -1,6 +1,6 @@
|
|||||||
export const load = async ({ locals, params }) => {
|
export const load = async ({ locals, params }) => {
|
||||||
const getSenateTrading = async () => {
|
const getSenateTrading = async () => {
|
||||||
const { apiURL, apiKey } = locals;
|
const { apiURL, apiKey, user} = locals;
|
||||||
|
|
||||||
const postData = {
|
const postData = {
|
||||||
ticker: params.tickerID,
|
ticker: params.tickerID,
|
||||||
@ -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;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
} from "$lib/store";
|
} from "$lib/store";
|
||||||
import { getPartyForPoliticians } from "$lib/utils";
|
import { getPartyForPoliticians } from "$lib/utils";
|
||||||
import TableHeader from "$lib/components/Table/TableHeader.svelte";
|
import TableHeader from "$lib/components/Table/TableHeader.svelte";
|
||||||
|
import UpgradeToPro from "$lib/components/UpgradeToPro.svelte";
|
||||||
|
|
||||||
export let data;
|
export let data;
|
||||||
|
|
||||||
@ -377,9 +378,14 @@
|
|||||||
<TableHeader {columns} {sortOrders} {sortData} />
|
<TableHeader {columns} {sortOrders} {sortData} />
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{#each senateTradingList as item}
|
{#each senateTradingList as item, index}
|
||||||
<tr
|
<tr
|
||||||
class="odd:bg-odd sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] border-b border-gray-800"
|
class="odd:bg-odd sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] border-b border-gray-800 {index +
|
||||||
|
1 ===
|
||||||
|
rawData?.slice(0, 3)?.length &&
|
||||||
|
data?.user?.tier !== 'Pro'
|
||||||
|
? 'opacity-[0.1]'
|
||||||
|
: ''}"
|
||||||
>
|
>
|
||||||
<td
|
<td
|
||||||
class="text-white text-sm sm:text-[1rem] whitespace-nowrap pb-3"
|
class="text-white text-sm sm:text-[1rem] whitespace-nowrap pb-3"
|
||||||
@ -455,6 +461,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<UpgradeToPro {data} />
|
||||||
{#if rawData?.length >= 20}
|
{#if rawData?.length >= 20}
|
||||||
<label
|
<label
|
||||||
on:click={backToTop}
|
on:click={backToTop}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user