From 01c073e879e02d4a340837586c45ee68f69c2c54 Mon Sep 17 00:00:00 2001 From: Mathis Date: Mon, 17 Jun 2024 09:50:06 +0200 Subject: [PATCH] feat(account-info): add disconnect handling and improve info display The commit enhances the account information component with better data handling. It adds disconnect handling to account for cases when user session is terminated. It also improves information display by adding details like crypto availability and user identity, improving the overall user experience. --- src/components/account-info.tsx | 85 ++++++++++++++++++++++++++++++--- 1 file changed, 78 insertions(+), 7 deletions(-) diff --git a/src/components/account-info.tsx b/src/components/account-info.tsx index c314f1b..140abb1 100644 --- a/src/components/account-info.tsx +++ b/src/components/account-info.tsx @@ -13,16 +13,46 @@ import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import type { IUserData } from "@/interfaces/userdata.interface"; -import { Landmark, Unplug, User, Wallet } from "lucide-react"; +import { CopyButton } from "@/components/ui/copy-button"; +import { doDisconnect } from "@/services/account.handler"; +import { Bitcoin, Fingerprint, Key, Landmark, Unplug, User, Wallet } from "lucide-react"; +import Link from "next/link"; import type React from "react"; export function AccountInfo({ userData, setUserData, + isDisconnected, }: { userData: IUserData; setUserData: React.Dispatch>; + isDisconnected: boolean; }) { + if (isDisconnected) { + return ( +
+
+ +

Disconnected

+
+
+ + Link account + +
+
+ ); + } + return ( @@ -37,12 +67,49 @@ export function AccountInfo({ {userData.city}
-
-
- -

{userData.dollarAvailables} $

+
+
+
+ +

+ {userData.dollarAvailables} $ +

+
+
+ +

+ You dont have cryptos. +

+
+
+
+
+ +

Your identity

+
+
+

{userData.id}

+ +
-
@@ -50,7 +117,11 @@ export function AccountInfo({

My wallet

-