From 0d798c1d6a0d6f17c21be8bc6ab41939591fe594 Mon Sep 17 00:00:00 2001 From: alvaromaoc Date: Mon, 2 Jun 2025 12:09:46 +0200 Subject: [PATCH] First iteration cool UI (colors) --- src/pages/webapp/Alerts.tsx | 76 +++++++++++++++++++++---------------- src/pages/webapp/News.tsx | 62 ++++++++++++++++-------------- 2 files changed, 76 insertions(+), 62 deletions(-) diff --git a/src/pages/webapp/Alerts.tsx b/src/pages/webapp/Alerts.tsx index 802d8ce..21e409b 100644 --- a/src/pages/webapp/Alerts.tsx +++ b/src/pages/webapp/Alerts.tsx @@ -5,6 +5,7 @@ import {AlertsHttpService} from "@/services/alerts-http-service.ts"; import {AssetsHttpService} from "@/services/assets-http-service.ts"; import {Asset} from "@/model/Asset.ts"; import {Badge} from "@/components/ui/badge.tsx"; +import {Card} from "@/components/ui/card.tsx"; const alertsHttpService = new AlertsHttpService(); const assetsHttpService = new AssetsHttpService(); @@ -31,6 +32,7 @@ function RecentAlerts() { setAssets(assets); setAlerts(alerts); } + fetchData().then(); }, []) @@ -47,43 +49,51 @@ function RecentAlerts() { {alerts.map((alert) => { const asset = getAsset(alert.assetId); return ( -
-
- {alert.type === "BUY" - ? - : (alert.type === "SELL" - ? - : ) - } -
-
-

- - {asset.mic} - {asset.ticker} - -

-

+ +

+
{alert.type === "BUY" - ? "Technical indicators sugests buying opportunity" + ? : (alert.type === "SELL" - ? "Technical indicators sugests selling opportunity" - : "Technical indicators sugests no change") + ? + : ) } -

-
-
- {alert.date.toLocaleString('en-US', { - year: 'numeric', - month: 'long', - day: 'numeric', - hour: 'numeric', - minute: '2-digit', - second: '2-digit', - hour12: true, - })} +
+
+

+ + {asset.mic} + {asset.ticker} + +

+

+ {alert.type === "BUY" + ? "Technical indicators sugests buying opportunity" + : (alert.type === "SELL" + ? "Technical indicators sugests selling opportunity" + : "Technical indicators sugests no change") + } +

+
+
+ {alert.date.toLocaleString('en-US', { + year: 'numeric', + month: 'long', + day: 'numeric', + hour: 'numeric', + minute: '2-digit', + second: '2-digit', + hour12: true, + })} +
-
+ ) })}
diff --git a/src/pages/webapp/News.tsx b/src/pages/webapp/News.tsx index 94c2381..6a44d91 100644 --- a/src/pages/webapp/News.tsx +++ b/src/pages/webapp/News.tsx @@ -5,6 +5,7 @@ import {NewsItem} from "@/model/NewsItem.ts"; import {AssetsHttpService} from "@/services/assets-http-service.ts"; import {Asset} from "@/model/Asset.ts"; import {Badge} from "@/components/ui/badge.tsx"; +import {Card} from "@/components/ui/card.tsx"; const newsHttpService = new NewsHttpService(); const assetsHttpService = new AssetsHttpService(); @@ -44,6 +45,7 @@ function RecentNews() { setAssets(assets); setNewsItems(newsItemsGrouped); } + fetchData().then(); }, []) @@ -61,36 +63,38 @@ function RecentNews() { const assets = newsItems.map(item => getAsset(item.assetId)); const uniqueAssets = Array.from(new Map(assets.map(item => [item.assetId, item])).values()); return ( -
-
- -
-
-

- {uniqueAssets.map(asset => ( - - {asset.mic} - {asset.ticker} - - ))} -

-

{newsItems[0].title}

-
-
- {newsItems[0].date.toLocaleString('en-US', { - year: 'numeric', - month: 'long', - day: 'numeric', - hour: 'numeric', - minute: '2-digit', - second: '2-digit', - hour12: true, - })} -
-
- + +
+
+ +
+
+

+ {uniqueAssets.map(asset => ( + + {asset.mic} + {asset.ticker} + + ))} +

+

{newsItems[0].title}

+
+
+ {newsItems[0].date.toLocaleString('en-US', { + year: 'numeric', + month: 'long', + day: 'numeric', + hour: 'numeric', + minute: '2-digit', + second: '2-digit', + hour12: true, + })} +
+
+ +
-
+ ) })}