From 13464d173b669a288d912ebed08261d065507c69 Mon Sep 17 00:00:00 2001 From: alvaromaoc Date: Tue, 3 Jun 2025 19:24:41 +0200 Subject: [PATCH] First iteration cool UI (clear news and alerts hover) --- src/pages/webapp/Dashboard.tsx | 24 +++++---- src/pages/webapp/Profile.tsx | 85 +++++++++++++++++-------------- src/pages/webapp/WebAppLayout.tsx | 32 ++++++------ 3 files changed, 79 insertions(+), 62 deletions(-) diff --git a/src/pages/webapp/Dashboard.tsx b/src/pages/webapp/Dashboard.tsx index c3d21ef..9e7a14d 100644 --- a/src/pages/webapp/Dashboard.tsx +++ b/src/pages/webapp/Dashboard.tsx @@ -6,7 +6,7 @@ import {AssetsHttpService} from "@/services/assets-http-service.ts"; import {Asset} from "@/model/Asset.ts"; import {useNavigate} from 'react-router-dom'; -import {ExclamationTriangleIcon, NewspaperIcon, PencilIcon,} from "@heroicons/react/16/solid"; +import {ChevronRightIcon, ExclamationTriangleIcon, NewspaperIcon, PencilIcon,} from "@heroicons/react/16/solid"; import { Drawer, @@ -102,10 +102,13 @@ function Summary() { return (
navigate("/news")} - className={"md:flex-1 bg-neutral-100 shadow-none hover:inset-ring-1 hover:inset-ring-neutral-200 border-none cursor-pointer"}> + className={"group md:flex-1 shadow-none cursor-pointer"}> -
- +
+
+ +
+
Market news @@ -115,10 +118,13 @@ function Summary() { navigate("/alerts")} - className={"md:flex-1 bg-neutral-100 shadow-none hover:inset-ring-1 hover:inset-ring-neutral-200 border-none cursor-pointer"}> + className={"group md:flex-1 shadow-none cursor-pointer"}> -
- +
+
+ +
+
Title @@ -150,7 +156,7 @@ const chartConfig = { }, } satisfies ChartConfig -function ChartLineDots({ chartData }: { chartData: ChartData[] }) { +function ChartLineDots({chartData}: { chartData: ChartData[] }) { const calculatePerformance: (arr: T[], key: K extends keyof T ? (T[K] extends number ? K : never) : never) => number = (arr, key) => { const first = arr.length > 0 ? arr[0] : undefined; const last = arr.length > 0 ? arr[arr.length - 1] : undefined; @@ -200,7 +206,7 @@ function ChartLineDots({ chartData }: { chartData: ChartData[] }) { axisLine={false} tickMargin={8} domain={([dataMin, dataMax]) => { - const margin = (dataMax - dataMin)/10; + const margin = (dataMax - dataMin) / 10; return [Math.max(0, dataMin - margin), dataMax + margin] }} tickFormatter={(value) => { diff --git a/src/pages/webapp/Profile.tsx b/src/pages/webapp/Profile.tsx index 3bb6eb6..510a915 100644 --- a/src/pages/webapp/Profile.tsx +++ b/src/pages/webapp/Profile.tsx @@ -5,6 +5,7 @@ import {ToggleGroup, ToggleGroupItem} from "@/components/ui/toggle-group.tsx"; import {Button} from "@/components/ui/button.tsx"; import {Input} from "@/components/ui/input.tsx"; import {Badge} from "@/components/ui/badge.tsx"; +import {Card, CardDescription, CardHeader, CardTitle} from "@/components/ui/card.tsx"; const usersHttpService = new UsersHttpService(); @@ -20,45 +21,53 @@ export default function Profile() { return ( <>

Profile

-
-
-

Personal information

- -
- - -
-
-
-

Risk profile

- { - if (newValue) { - setUser(user => ({...user, riskLevel: parseInt(newValue)} as User)) - } - }} - > - {/* TODO: Fetch risk levels from back */} - {[1, 2, 3, 4].map((riskLevelItem, index) => ( - + + + Personal information + + +
+ + +
+
+
+
+ + + Risk profile + + { + if (newValue) { + setUser(user => ({...user, riskLevel: parseInt(newValue)} as User)) + } + }} > - {riskLevelItem} -
- ))} -
- - {user.riskLevel === 1 && "Conservative"} - {user.riskLevel === 2 && "Moderate"} - {user.riskLevel === 3 && "Aggressive"} - {user.riskLevel === 4 && "Very aggressive"} - -
+ {/* TODO: Fetch risk levels from back */} + {[1, 2, 3, 4].map((riskLevelItem, index) => ( + + {riskLevelItem} + + ))} + + + {user.riskLevel === 1 && "Conservative"} + {user.riskLevel === 2 && "Moderate"} + {user.riskLevel === 3 && "Aggressive"} + {user.riskLevel === 4 && "Very aggressive"} + + + +

- - - Profile +
+
+
+ + {location.pathname !== "/dashboard" && } + AutoInvestor +
+ + + + Profile + +
+
-
) }