ui fixes
This commit is contained in:
parent
d53b2d14e1
commit
240ad1f993
@ -7,7 +7,7 @@
|
|||||||
export let data;
|
export let data;
|
||||||
import * as Tabs from "$lib/components/shadcn/tabs/index.js";
|
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 rating = "";
|
||||||
let inputValue = "";
|
let inputValue = "";
|
||||||
@ -92,7 +92,7 @@
|
|||||||
<span class="text-black hidden sm:block text-md px-3"> Feedback </span>
|
<span class="text-black hidden sm:block text-md px-3"> Feedback </span>
|
||||||
<img
|
<img
|
||||||
class="hidden sm:inline-block w-12 -mt-6 opacity-[0.85]"
|
class="hidden sm:inline-block w-12 -mt-6 opacity-[0.85]"
|
||||||
src={cloudFrontUrl + "/assets/feedback_icon.png"}
|
src={feedback_icon}
|
||||||
alt="feedback logo"
|
alt="feedback logo"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@ -153,7 +153,7 @@
|
|||||||
{#if newsList?.length !== rawData?.length}
|
{#if newsList?.length !== rawData?.length}
|
||||||
<label
|
<label
|
||||||
on:click={loadMoreData}
|
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
|
Load More News
|
||||||
</label>
|
</label>
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
import "../app.pcss";
|
import "../app.pcss";
|
||||||
|
|
||||||
import { Toaster } from "svelte-french-toast";
|
import { Toaster } from "svelte-french-toast";
|
||||||
import { getImageURL } from "$lib/utils";
|
|
||||||
|
|
||||||
import NProgress from "nprogress";
|
import NProgress from "nprogress";
|
||||||
import "nprogress/nprogress.css";
|
import "nprogress/nprogress.css";
|
||||||
@ -24,7 +23,6 @@
|
|||||||
import {
|
import {
|
||||||
clearCache,
|
clearCache,
|
||||||
showCookieConsent,
|
showCookieConsent,
|
||||||
newAvatar,
|
|
||||||
screenWidth,
|
screenWidth,
|
||||||
stockTicker,
|
stockTicker,
|
||||||
etfTicker,
|
etfTicker,
|
||||||
@ -36,7 +34,6 @@
|
|||||||
import { Button } from "$lib/components/shadcn/button/index.ts";
|
import { Button } from "$lib/components/shadcn/button/index.ts";
|
||||||
import * as Card from "$lib/components/shadcn/card/index.ts";
|
import * as Card from "$lib/components/shadcn/card/index.ts";
|
||||||
import * as DropdownMenu from "$lib/components/shadcn/dropdown-menu/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 Sheet from "$lib/components/shadcn/sheet/index.ts";
|
||||||
import * as Accordion from "$lib/components/shadcn/accordion/index.js";
|
import * as Accordion from "$lib/components/shadcn/accordion/index.js";
|
||||||
|
|
||||||
@ -51,40 +48,10 @@
|
|||||||
import Newspaper from "lucide-svelte/icons/newspaper";
|
import Newspaper from "lucide-svelte/icons/newspaper";
|
||||||
import AudioLine from "lucide-svelte/icons/audio-lines";
|
import AudioLine from "lucide-svelte/icons/audio-lines";
|
||||||
import Gem from "lucide-svelte/icons/gem";
|
import Gem from "lucide-svelte/icons/gem";
|
||||||
|
import stocknear_logo from "$lib/images/stocknear_logo.png";
|
||||||
|
|
||||||
export let data;
|
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;
|
let hideHeader = false;
|
||||||
|
|
||||||
NProgress.configure({ showSpinner: false });
|
NProgress.configure({ showSpinner: false });
|
||||||
@ -107,13 +74,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$: hideFooter =
|
$: hideFooter = $page.url.pathname.startsWith("/options-flow");
|
||||||
$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");
|
|
||||||
|
|
||||||
let hasUnreadElement = false;
|
let hasUnreadElement = false;
|
||||||
let notificationList = [];
|
let notificationList = [];
|
||||||
@ -125,18 +86,10 @@
|
|||||||
const output = event.data?.output;
|
const output = event.data?.output;
|
||||||
notificationList = output?.notificationList;
|
notificationList = output?.notificationList;
|
||||||
hasUnreadElement = output?.hasUnreadElement;
|
hasUnreadElement = output?.hasUnreadElement;
|
||||||
//const unreadNotificationList = output?.unreadNotificationList;
|
|
||||||
$numberOfUnreadNotification = output?.numberOfUnreadNotification?.length;
|
$numberOfUnreadNotification = output?.numberOfUnreadNotification?.length;
|
||||||
//pushNotification()
|
//pushNotification()
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
const handleTwitchMessage = (event) => {
|
|
||||||
const output = event.data?.output;
|
|
||||||
$twitchStatus = output?.twitchStatus;
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
const loadWorker = async () => {
|
const loadWorker = async () => {
|
||||||
if ("serviceWorker" in navigator) {
|
if ("serviceWorker" in navigator) {
|
||||||
const SyncWorker = await import("$lib/workers/notificationWorker?worker");
|
const SyncWorker = await import("$lib/workers/notificationWorker?worker");
|
||||||
@ -211,8 +164,6 @@ const handleTwitchMessage = (event) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let innerWidth;
|
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
if ($stockTicker && !$clientSideCache[$stockTicker]) {
|
if ($stockTicker && !$clientSideCache[$stockTicker]) {
|
||||||
$clientSideCache[$stockTicker] = {};
|
$clientSideCache[$stockTicker] = {};
|
||||||
@ -224,22 +175,9 @@ const handleTwitchMessage = (event) => {
|
|||||||
$clientSideCache[$etfTicker] = {};
|
$clientSideCache[$etfTicker] = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$: {
|
|
||||||
if ($newAvatar?.length !== 0) {
|
|
||||||
data.user.avatar = $newAvatar;
|
|
||||||
$newAvatar = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$: {
|
|
||||||
if (innerWidth) {
|
|
||||||
$screenWidth = innerWidth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window bind:innerWidth />
|
<svelte:window bind:innerWidth={$screenWidth} />
|
||||||
|
|
||||||
<div class="app {$page?.url?.pathname === '/' ? 'bg-[#000]' : ''}">
|
<div class="app {$page?.url?.pathname === '/' ? 'bg-[#000]' : ''}">
|
||||||
<div class="flex min-h-screen w-full flex-col bg-[#09090B]">
|
<div class="flex min-h-screen w-full flex-col bg-[#09090B]">
|
||||||
@ -276,7 +214,7 @@ const handleTwitchMessage = (event) => {
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
class="avatar w-9 sm:w-10 rounded-full"
|
class="avatar w-9 sm:w-10 rounded-full"
|
||||||
src={cloudFrontUrl + "/assets/stocknear_logo.png"}
|
src={stocknear_logo}
|
||||||
/>
|
/>
|
||||||
Stocknear
|
Stocknear
|
||||||
</a>
|
</a>
|
||||||
@ -804,10 +742,7 @@ const handleTwitchMessage = (event) => {
|
|||||||
</Sheet.Root>
|
</Sheet.Root>
|
||||||
|
|
||||||
<a href="/" class="-ml-2 flex flex-shrink-0">
|
<a href="/" class="-ml-2 flex flex-shrink-0">
|
||||||
<img
|
<img class="avatar w-9 3xl:w-10 rounded-full" src={stocknear_logo} />
|
||||||
class="avatar w-9 3xl:w-10 rounded-full"
|
|
||||||
src={cloudFrontUrl + "/assets/stocknear_logo.png"}
|
|
||||||
/>
|
|
||||||
<span class="text-white font-semibold ml-2 text-lg">Stocknear</span>
|
<span class="text-white font-semibold ml-2 text-lg">Stocknear</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@ -900,7 +835,7 @@ const handleTwitchMessage = (event) => {
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
class="avatar w-9 3xl:w-12 rounded-full"
|
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>
|
<span class="text-white text-xl">Stocknear</span>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user