From b79d0c533bd13427e4ae5f8c278b1c07d62747fe Mon Sep 17 00:00:00 2001 From: Ilja Date: Fri, 4 Feb 2022 16:31:23 +0200 Subject: [PATCH] Account card component and helper utils --- wallets/react-wallet-v2/package.json | 2 +- .../src/components/AccountCard.tsx | 41 ++++++++++++++++++- .../src/components/PageHeader.tsx | 9 ++-- .../src/containers/GlobalLayout.tsx | 2 +- wallets/react-wallet-v2/src/pages/index.tsx | 12 +++++- .../react-wallet-v2/src/store/WalletStore.ts | 4 +- .../src/utils/EIP155ChainsUtil.ts | 34 +++++++++++++++ .../react-wallet-v2/src/utils/HelperUtil.ts | 12 ++++++ wallets/react-wallet-v2/yarn.lock | 7 +++- 9 files changed, 110 insertions(+), 13 deletions(-) create mode 100644 wallets/react-wallet-v2/src/utils/EIP155ChainsUtil.ts create mode 100644 wallets/react-wallet-v2/src/utils/HelperUtil.ts diff --git a/wallets/react-wallet-v2/package.json b/wallets/react-wallet-v2/package.json index 2243801..5d6329f 100644 --- a/wallets/react-wallet-v2/package.json +++ b/wallets/react-wallet-v2/package.json @@ -16,8 +16,8 @@ "next-themes": "0.0.15", "react": "17.0.2", "react-dom": "17.0.2", + "react-iconly": "2.2.5", "ethers": "5.5.4", - "keyvaluestorage": "0.7.1", "valtio": "1.2.11" }, "devDependencies": { diff --git a/wallets/react-wallet-v2/src/components/AccountCard.tsx b/wallets/react-wallet-v2/src/components/AccountCard.tsx index 2d65672..8904d08 100644 --- a/wallets/react-wallet-v2/src/components/AccountCard.tsx +++ b/wallets/react-wallet-v2/src/components/AccountCard.tsx @@ -1,3 +1,40 @@ -export default function AccountCard() { - return null +import { truncate } from '@/utils/HelperUtil' +import { Avatar, Button, Card, Text } from '@nextui-org/react' +import { Paper } from 'react-iconly' + +interface Props { + name: string + logo: string + rgb: string + address: string +} + +export default function AccountCard({ name, logo, rgb, address }: Props) { + return ( + + + +
+ + {name} + + + {truncate(address, 19)} + +
+