diff --git a/src/routes/home/+page.svelte b/src/routes/home/+page.svelte index bbba1462..ce0f2fb8 100644 --- a/src/routes/home/+page.svelte +++ b/src/routes/home/+page.svelte @@ -10,8 +10,9 @@ import Crown from "lucide-svelte/icons/crown"; import Activity from "lucide-svelte/icons/activity"; import { abbreviateNumber, formatDate } from '$lib/utils'; - - import { numberOfUnreadNotification} from '$lib/store'; + import * as Tabs from "$lib/components/shadcn/tabs/index.js"; + + import { screenWidth, numberOfUnreadNotification} from '$lib/store'; /* import { Chart } from 'svelte-echarts' @@ -28,6 +29,7 @@ export let data; let isLoaded = false; const quickInfo = data?.getDashboard?.quickInfo; + let optionsMode = 'premium'; function compareTimes(time1, time2) { @@ -156,8 +158,18 @@ function latestInfoDate(inputDate) { return differenceInDays <=1; } +let optionsTable = data?.getDashboard?.optionsFlow?.premium || []; - +function changeTable(state) { + optionsMode = state; + if (optionsMode === 'premium') { + optionsTable = data?.getDashboard?.optionsFlow?.premium || []; + } else if (optionsMode === 'volume') { + optionsTable = data?.getDashboard?.optionsFlow?.volume || []; + } else { + optionsTable = data?.getDashboard?.optionsFlow?.openInterest || []; + } +} let Feedback; onMount( async() => { @@ -325,37 +337,44 @@ onMount( async() => {