This commit is contained in:
MuslemRahimi 2024-11-27 11:50:41 +01:00
parent d53b2d14e1
commit 240ad1f993
3 changed files with 9 additions and 74 deletions

View File

@ -7,7 +7,7 @@
export let data;
import * as Tabs from "$lib/components/shadcn/tabs/index.js";
let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL;
import feedback_icon from "$lib/images/feedback_icon.png";
let rating = "";
let inputValue = "";
@ -92,7 +92,7 @@
<span class="text-black hidden sm:block text-md px-3"> Feedback </span>
<img
class="hidden sm:inline-block w-12 -mt-6 opacity-[0.85]"
src={cloudFrontUrl + "/assets/feedback_icon.png"}
src={feedback_icon}
alt="feedback logo"
/>
</label>

View File

@ -153,7 +153,7 @@
{#if newsList?.length !== rawData?.length}
<label
on:click={loadMoreData}
class="shadow-lg rounded-md cursor-pointer w-5/6 sm:w-full sm:max-w-3xl flex justify-center items-center py-3 h-full text-sm sm:text-[1rem] text-center font-semibold text-white m-auto sm:hover:bg-gray-300 bg-[#fff]"
class="shadow-lg rounded-md cursor-pointer w-5/6 sm:w-full sm:max-w-3xl flex justify-center items-center py-3 h-full text-sm sm:text-[1rem] text-center font-semibold text-black m-auto sm:hover:bg-gray-300 bg-[#fff]"
>
Load More News
</label>

View File

@ -5,7 +5,6 @@
import "../app.pcss";
import { Toaster } from "svelte-french-toast";
import { getImageURL } from "$lib/utils";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
@ -24,7 +23,6 @@
import {
clearCache,
showCookieConsent,
newAvatar,
screenWidth,
stockTicker,
etfTicker,
@ -36,7 +34,6 @@
import { Button } from "$lib/components/shadcn/button/index.ts";
import * as Card from "$lib/components/shadcn/card/index.ts";
import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/index.ts";
//import { Input } from "$lib/components/shadcn/input/index.ts";
import * as Sheet from "$lib/components/shadcn/sheet/index.ts";
import * as Accordion from "$lib/components/shadcn/accordion/index.js";
@ -51,40 +48,10 @@
import Newspaper from "lucide-svelte/icons/newspaper";
import AudioLine from "lucide-svelte/icons/audio-lines";
import Gem from "lucide-svelte/icons/gem";
import stocknear_logo from "$lib/images/stocknear_logo.png";
export let data;
let cloudFrontUrl = import.meta.env.VITE_IMAGE_URL;
//const trialLeftDays = Math?.floor(addDays(data, 7, ''));
async function pushNotification() {
Notification?.requestPermission()?.then((perm) => {
if (perm === "granted") {
new Notification("Stocknear", {
body: "this is more text",
});
}
});
}
//Check Service Worker (SW)
async function detectSWUpdate() {
const registration = await navigator.serviceWorker.ready;
registration.addEventListener("updatefound", () => {
const newSW = registration.installing;
newSW?.addEventListener("statechange", () => {
if (newSW.state === "installed") {
if (confirm("New Update available! Reload to update?")) {
newSW.postMessage({ type: "SKIP_WAITING" });
window.location.reload();
}
}
});
});
}
let hideHeader = false;
NProgress.configure({ showSpinner: false });
@ -107,13 +74,7 @@
}
}
$: hideFooter =
$page.url.pathname.startsWith("/options-flow") ||
$page.url.pathname.startsWith("/options-zero-dte") ||
$page.url.pathname.startsWith("/login") ||
$page.url.pathname.startsWith("/etf") ||
$page.url.pathname.startsWith("/portfolio") ||
$page.url.pathname.startsWith("/hedge-funds");
$: hideFooter = $page.url.pathname.startsWith("/options-flow");
let hasUnreadElement = false;
let notificationList = [];
@ -125,18 +86,10 @@
const output = event.data?.output;
notificationList = output?.notificationList;
hasUnreadElement = output?.hasUnreadElement;
//const unreadNotificationList = output?.unreadNotificationList;
$numberOfUnreadNotification = output?.numberOfUnreadNotification?.length;
//pushNotification()
};
/*
const handleTwitchMessage = (event) => {
const output = event.data?.output;
$twitchStatus = output?.twitchStatus;
};
*/
const loadWorker = async () => {
if ("serviceWorker" in navigator) {
const SyncWorker = await import("$lib/workers/notificationWorker?worker");
@ -211,8 +164,6 @@ const handleTwitchMessage = (event) => {
}
}
let innerWidth;
$: {
if ($stockTicker && !$clientSideCache[$stockTicker]) {
$clientSideCache[$stockTicker] = {};
@ -224,22 +175,9 @@ const handleTwitchMessage = (event) => {
$clientSideCache[$etfTicker] = {};
}
}
$: {
if ($newAvatar?.length !== 0) {
data.user.avatar = $newAvatar;
$newAvatar = "";
}
}
$: {
if (innerWidth) {
$screenWidth = innerWidth;
}
}
</script>
<svelte:window bind:innerWidth />
<svelte:window bind:innerWidth={$screenWidth} />
<div class="app {$page?.url?.pathname === '/' ? 'bg-[#000]' : ''}">
<div class="flex min-h-screen w-full flex-col bg-[#09090B]">
@ -276,7 +214,7 @@ const handleTwitchMessage = (event) => {
>
<img
class="avatar w-9 sm:w-10 rounded-full"
src={cloudFrontUrl + "/assets/stocknear_logo.png"}
src={stocknear_logo}
/>
Stocknear
</a>
@ -804,10 +742,7 @@ const handleTwitchMessage = (event) => {
</Sheet.Root>
<a href="/" class="-ml-2 flex flex-shrink-0">
<img
class="avatar w-9 3xl:w-10 rounded-full"
src={cloudFrontUrl + "/assets/stocknear_logo.png"}
/>
<img class="avatar w-9 3xl:w-10 rounded-full" src={stocknear_logo} />
<span class="text-white font-semibold ml-2 text-lg">Stocknear</span>
</a>
@ -900,7 +835,7 @@ const handleTwitchMessage = (event) => {
>
<img
class="avatar w-9 3xl:w-12 rounded-full"
src={cloudFrontUrl + "/assets/stocknear_logo.png"}
src={stocknear_logo}
/>
<span class="text-white text-xl">Stocknear</span>
</a>