From 4170f3a1d2199b039777658dceb2ff2e0a337e2d Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Sun, 9 Mar 2025 22:56:57 +0100 Subject: [PATCH] ui fix --- src/routes/price-alert/+page.svelte | 145 +++++++++++++--------------- 1 file changed, 67 insertions(+), 78 deletions(-) diff --git a/src/routes/price-alert/+page.svelte b/src/routes/price-alert/+page.svelte index 253b3df6..f7c85c32 100644 --- a/src/routes/price-alert/+page.svelte +++ b/src/routes/price-alert/+page.svelte @@ -13,7 +13,6 @@ import { goto } from "$app/navigation"; import { screenWidth, newPriceAlertData } from "$lib/store"; - import ArrowLogo from "lucide-svelte/icons/move-up-right"; import HoverStockChart from "$lib/components/HoverStockChart.svelte"; import { Combobox } from "bits-ui"; import PriceAlert from "$lib/components/PriceAlert.svelte"; @@ -84,7 +83,7 @@ async function handleDeleteTickers() { if (numberOfChecked === 0) { - toast.error(`You need to select symbols before you can delete them`, { + toast?.error(`You need to select symbols before you can delete them`, { style: `border-radius: 5px; background: #fff; color: #000; border-color: ${$mode === "light" ? "#F9FAFB" : "#4B5563"}; font-size: 15px;`, }); } else { @@ -116,7 +115,7 @@ groupedEarnings = [...groupEarnings(earnings)]; } else { groupedEarnings = []; - groupedEarnings = []; + groupedNews = []; } const postData = { @@ -271,12 +270,12 @@ />
@@ -287,9 +286,7 @@ >
-

- Price Alerts -

+

Price Alerts

{#if data?.user} @@ -301,46 +298,44 @@ {#if editMode} {/if} @@ -373,35 +368,37 @@ {#if inputValue?.length !== 0} {#each searchBarData as item} handleAddAlert(e, item?.symbol, item?.type)} >
- {item?.symbol} - {item?.name}
{:else} - + No results found {/each} @@ -416,36 +413,28 @@ class="w-full rounded-md overflow-hidden overflow-x-auto no-scrollbar" > - + - - + + - - - - - + + + + {#each priceAlertList as item} - @@ -524,15 +511,15 @@
-
+
{#each tabs as item, i} {#if !["Pro", "Plus"]?.includes(data?.user?.tier) && i > 0} @@ -572,7 +559,7 @@ class="relative text-sm sm:text-[1rem] block font-semibold {activeIdx === i ? 'text-black' - : 'text-white'}" + : ''}" > {item.title} @@ -584,14 +571,16 @@ {#if activeIdx === 0} {#if groupedNews?.length > 0} {#each displayList as [date, titleGroups]} -

+

{date}

-
+
{#each titleGroups as { title, items, symbols }} -
+

-
+
{new Date( items[0].publishedDate, ).toLocaleTimeString("en-US", { @@ -628,7 +617,7 @@ hour12: true, })}
-
+
{items[0].site}
· @@ -636,7 +625,7 @@ {#each symbols as symbol}
{symbol} @@ -659,16 +648,18 @@

{date}

-
+
{#each titleGroups as item} -
+
{item?.name} @@ -713,7 +704,7 @@
-
+
{formatTime(item?.time)}
@@ -733,13 +724,11 @@ {/if} {#if priceAlertList?.length === 0}
- + No Alerts set - + Create price alerts for your stocks that have the most potential in your opinion.

SymbolCompanySymbolCompanyPrice TargetCondition - Price% ChangeVolumeCondition Price% ChangeVolume
handleFilter(item?.id)} @@ -457,11 +446,11 @@ false} class="{!editMode ? 'hidden' - : ''} bg-[#2E3238] h-[18px] w-[18px] rounded-sm ring-offset-0 mr-3 cursor-pointer" + : ''} dark:bg-[#2E3238] h-[18px] w-[18px] rounded-sm ring-offset-0 mr-3 cursor-pointer" /> {#if editMode} @@ -473,47 +462,45 @@ {/if} + {item?.name?.length > charNumber ? item?.name?.slice(0, charNumber) + "..." : item?.name} {item?.targetPrice} {item?.condition} - {item.price?.toFixed(2)} + {item?.price?.toFixed(2)} {#if item?.changesPercentage >= 0} - +{item?.changesPercentage?.toFixed(2)}% {:else} - {item?.changesPercentage?.toFixed(2)}% {/if} {abbreviateNumber(item?.volume)}