From 7a2bc1ba47cd232458220ee73ff0ba57cbd06edf Mon Sep 17 00:00:00 2001
From: MuslemRahimi
Date: Sun, 9 Feb 2025 23:37:44 +0100
Subject: [PATCH] update index page
---
src/lib/components/IndexSidecard.svelte | 119 +-----------------
src/lib/components/News.svelte | 7 +-
src/lib/components/WIIM.svelte | 4 +-
src/routes/etf/[tickerID]/+layout.svelte | 6 +-
src/routes/index/[tickerID]/+layout.server.ts | 5 +-
src/routes/index/[tickerID]/+layout.svelte | 47 ++-----
src/routes/index/[tickerID]/+page.svelte | 57 +++++----
.../index/[tickerID]/history/+page.svelte | 44 +------
.../index/[tickerID]/holdings/+page.server.ts | 11 +-
.../index/[tickerID]/holdings/+page.svelte | 42 +------
.../index/[tickerID]/options/+layout.svelte | 32 ++---
.../index/[tickerID]/options/+page.svelte | 6 +-
.../[tickerID]/options/dex/+layout.svelte | 10 +-
.../index/[tickerID]/options/dex/+page.svelte | 4 +-
.../options/dex/expiry/+page.svelte | 4 +-
.../options/dex/strike/+page.svelte | 4 +-
.../[tickerID]/options/gex/+layout.svelte | 10 +-
.../options/gex/expiry/+page.svelte | 4 +-
.../options/hottest-contracts/+page.svelte | 10 +-
.../[tickerID]/options/oi/+layout.svelte | 8 +-
.../[tickerID]/options/oi/expiry/+page.svelte | 4 +-
.../options/unusual-activity/+page.server.ts | 49 --------
.../options/unusual-activity/+page.svelte | 37 ------
.../options/volatility/+page.svelte | 4 +-
src/routes/stocks/[tickerID]/+layout.svelte | 4 +-
25 files changed, 114 insertions(+), 418 deletions(-)
delete mode 100644 src/routes/index/[tickerID]/options/unusual-activity/+page.server.ts
delete mode 100644 src/routes/index/[tickerID]/options/unusual-activity/+page.svelte
diff --git a/src/lib/components/IndexSidecard.svelte b/src/lib/components/IndexSidecard.svelte
index 05d9d57f..70c5aed6 100644
--- a/src/lib/components/IndexSidecard.svelte
+++ b/src/lib/components/IndexSidecard.svelte
@@ -1,47 +1,28 @@
@@ -54,22 +35,7 @@
{description}
-
- {$etfTicker} Stock Price History
+ {$indexTicker} Stock Price History
{
const { apiKey, apiURL } = locals;
const getETFHoldings = async () => {
- const postData = {
- ticker: params.tickerID,
- };
+
+ console.log(params.tickerID?.toLowerCase())
+
+ let postData = {ticker: params.tickerID,}
+ if (params.tickerID?.toLowerCase() === '^spx') {
+ postData['ticker'] = 'spy';
+ }
+
// make the POST request to the endpoint
const response = await fetch(apiURL + "/etf-holdings", {
diff --git a/src/routes/index/[tickerID]/holdings/+page.svelte b/src/routes/index/[tickerID]/holdings/+page.svelte
index bc4a5206..e0eee688 100644
--- a/src/routes/index/[tickerID]/holdings/+page.svelte
+++ b/src/routes/index/[tickerID]/holdings/+page.svelte
@@ -1,12 +1,12 @@
-
-
-
-
- {$numberOfUnreadNotification > 0 ? `(${$numberOfUnreadNotification})` : ""}
- {$displayCompanyName} ({$etfTicker}) Holdings List · Stocknear
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
- {$etfTicker} Holdings List
+ {$indexTicker} Holdings List
{#if data?.getETFHoldings?.lastUpdate}
- import { etfTicker } from "$lib/store";
+ import { indexTicker } from "$lib/store";
import ArrowLogo from "lucide-svelte/icons/move-up-right";
import { page } from "$app/stores";
@@ -11,7 +11,6 @@
const subSectionMap = {
overview: "/options",
"hottest-contracts": "/options/hottest-contracts",
- "unusual-activity": "/options/unusual-activity",
volatility: "/options/volatility",
gex: "/options/gex",
dex: "/options/dex",
@@ -20,10 +19,10 @@
if (state !== "overview" && subSectionMap[state]) {
displaySubSection = state;
- //goto(`/etf/${$etfTicker}${subSectionMap[state]}`);
+ //goto(`/index/${$indexTicker}${subSectionMap[state]}`);
} else {
displaySubSection = state;
- //goto(`/etf/${$etfTicker}/statistics`);
+ //goto(`/index/${$indexTicker}/statistics`);
}
}
@@ -33,7 +32,6 @@
const sectionMap = {
overview: "overview",
"hottest-contracts": "hottest-contracts",
- "unusual-activity": "unusual-activity",
volatility: "volatility",
gex: "gex",
dex: "dex",
@@ -64,7 +62,7 @@
>
changeSubSection("overview")}
class="p-2 px-5 cursor-pointer {displaySubSection === 'overview'
? 'text-white bg-primary sm:hover:bg-opacity-[0.95]'
@@ -73,17 +71,7 @@
Overview
changeSubSection("unusual-activity")}
- class="p-2 px-5 cursor-pointer {displaySubSection ===
- 'unusual-activity'
- ? 'text-white bg-primary sm:hover:bg-opacity-[0.95]'
- : 'text-gray-400 sm:hover:text-white sm:hover:bg-primary sm:hover:bg-opacity-[0.95]'}"
- >
- Unusual Activity
-
- changeSubSection("hottest-contracts")}
class="p-2 px-5 cursor-pointer {displaySubSection ===
'hottest-contracts'
@@ -93,7 +81,7 @@
Hottest Contracts
changeSubSection("volatility")}
class="p-2 px-5 cursor-pointer {displaySubSection ===
'volatility'
@@ -103,7 +91,7 @@
Volatility
changeSubSection("oi")}
class="p-2 px-5 cursor-pointer {displaySubSection === 'oi'
? 'text-white bg-primary sm:hover:bg-opacity-[0.95]'
@@ -113,7 +101,7 @@
changeSubSection("gex")}
class="p-2 px-5 cursor-pointer {displaySubSection === 'gex'
? 'text-white bg-primary sm:hover:bg-opacity-[0.95]'
@@ -122,7 +110,7 @@
GEX
changeSubSection("dex")}
class="p-2 px-5 cursor-pointer {displaySubSection === 'dex'
? 'text-white bg-primary sm:hover:bg-opacity-[0.95]'
@@ -142,7 +130,7 @@
class="w-full text-white border border-gray-600 rounded-md h-fit pb-4 mt-4 cursor-pointer bg-inherit sm:hover:bg-secondary transition ease-out duration-100"
>
diff --git a/src/routes/index/[tickerID]/options/+page.svelte b/src/routes/index/[tickerID]/options/+page.svelte
index 9769618c..a16a205e 100644
--- a/src/routes/index/[tickerID]/options/+page.svelte
+++ b/src/routes/index/[tickerID]/options/+page.svelte
@@ -1,5 +1,5 @@
Contract: {$etfTicker}
+ >{$indexTicker}
{strikePrice}
{optionType}
{dateExpiration} ({daysLeft(dateExpiration)})
diff --git a/src/routes/index/[tickerID]/options/oi/+layout.svelte b/src/routes/index/[tickerID]/options/oi/+layout.svelte
index c74d732a..d9b74160 100644
--- a/src/routes/index/[tickerID]/options/oi/+layout.svelte
+++ b/src/routes/index/[tickerID]/options/oi/+layout.svelte
@@ -1,5 +1,5 @@
-
-
-
-
-
-
- {#if data?.getData?.length > 0}
-
- {:else}
-
- {/if}
-
-
-
diff --git a/src/routes/index/[tickerID]/options/volatility/+page.svelte b/src/routes/index/[tickerID]/options/volatility/+page.svelte
index 239f8db6..a8631211 100644
--- a/src/routes/index/[tickerID]/options/volatility/+page.svelte
+++ b/src/routes/index/[tickerID]/options/volatility/+page.svelte
@@ -1,5 +1,5 @@
diff --git a/src/routes/stocks/[tickerID]/+layout.svelte b/src/routes/stocks/[tickerID]/+layout.svelte
index 288e4923..1b8c086f 100644
--- a/src/routes/stocks/[tickerID]/+layout.svelte
+++ b/src/routes/stocks/[tickerID]/+layout.svelte
@@ -389,9 +389,7 @@
class="flex-1 flex-shrink-0 flex flex-row items-center justify-between -mt-2"
>