From c94076a35c6a5ba94a771fd20e51693883281c6b Mon Sep 17 00:00:00 2001 From: Ilja Date: Wed, 16 Feb 2022 15:46:42 +0200 Subject: [PATCH] prep session and pairing pages --- wallets/react-wallet-v2/public/main.css | 8 +++ .../react-wallet-v2/public/pairings-icon.svg | 59 +++++++++++++++++++ .../react-wallet-v2/public/sessions-icon.svg | 19 ++++++ .../src/components/AccountCard.tsx | 58 +++++++++--------- .../src/components/Navigation.tsx | 24 ++++++-- .../react-wallet-v2/src/pages/pairings.tsx | 14 +++++ .../react-wallet-v2/src/pages/sessions.tsx | 14 ++--- .../src/views/SessionSendTransactionModal.tsx | 2 +- 8 files changed, 150 insertions(+), 48 deletions(-) create mode 100644 wallets/react-wallet-v2/public/pairings-icon.svg create mode 100644 wallets/react-wallet-v2/public/sessions-icon.svg create mode 100644 wallets/react-wallet-v2/src/pages/pairings.tsx diff --git a/wallets/react-wallet-v2/public/main.css b/wallets/react-wallet-v2/public/main.css index d862414..530451c 100644 --- a/wallets/react-wallet-v2/public/main.css +++ b/wallets/react-wallet-v2/public/main.css @@ -49,4 +49,12 @@ .codeBlock span { background-color: transparent !important; overflow: scroll; +} + +.navLink { + transition: ease-in-out .2s opacity; +} + +.navLink:hover { + opacity: 0.6; } \ No newline at end of file diff --git a/wallets/react-wallet-v2/public/pairings-icon.svg b/wallets/react-wallet-v2/public/pairings-icon.svg new file mode 100644 index 0000000..05d38a8 --- /dev/null +++ b/wallets/react-wallet-v2/public/pairings-icon.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/wallets/react-wallet-v2/public/sessions-icon.svg b/wallets/react-wallet-v2/public/sessions-icon.svg new file mode 100644 index 0000000..0b74731 --- /dev/null +++ b/wallets/react-wallet-v2/public/sessions-icon.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/wallets/react-wallet-v2/src/components/AccountCard.tsx b/wallets/react-wallet-v2/src/components/AccountCard.tsx index fb6ff69..0350aff 100644 --- a/wallets/react-wallet-v2/src/components/AccountCard.tsx +++ b/wallets/react-wallet-v2/src/components/AccountCard.tsx @@ -1,6 +1,5 @@ import { truncate } from '@/utils/HelperUtil' import { Avatar, Card, Text } from '@nextui-org/react' -import Link from 'next/link' interface Props { name: string @@ -11,38 +10,35 @@ interface Props { export default function AccountCard({ name, logo, rgb, address }: Props) { return ( - - + - - -
- - {name} - - - {truncate(address, 19)} - -
-
-
- + +
+ + {name} + + + {truncate(address, 19)} + +
+ + ) } diff --git a/wallets/react-wallet-v2/src/components/Navigation.tsx b/wallets/react-wallet-v2/src/components/Navigation.tsx index 1802690..344db92 100644 --- a/wallets/react-wallet-v2/src/components/Navigation.tsx +++ b/wallets/react-wallet-v2/src/components/Navigation.tsx @@ -4,15 +4,21 @@ import Link from 'next/link' export default function Navigation() { return ( - + - - accounts icon + + accounts icon + + + + + + sessions icon - + + + + pairings icon + + + - - settings icon + + settings icon diff --git a/wallets/react-wallet-v2/src/pages/pairings.tsx b/wallets/react-wallet-v2/src/pages/pairings.tsx new file mode 100644 index 0000000..933c433 --- /dev/null +++ b/wallets/react-wallet-v2/src/pages/pairings.tsx @@ -0,0 +1,14 @@ +import PageHeader from '@/components/PageHeader' +import { walletConnectClient } from '@/utils/WalletConnectUtil' +import { Fragment } from 'react' + +export default function PairingsPage() { + console.log(walletConnectClient.session.values) + console.log(walletConnectClient.session.history.pending) + + return ( + + Pairings + + ) +} diff --git a/wallets/react-wallet-v2/src/pages/sessions.tsx b/wallets/react-wallet-v2/src/pages/sessions.tsx index 5b0e968..2e6b6b5 100644 --- a/wallets/react-wallet-v2/src/pages/sessions.tsx +++ b/wallets/react-wallet-v2/src/pages/sessions.tsx @@ -1,20 +1,14 @@ import PageHeader from '@/components/PageHeader' -import { truncate } from '@/utils/HelperUtil' import { walletConnectClient } from '@/utils/WalletConnectUtil' -import { useRouter } from 'next/router' -import { Fragment, useEffect } from 'react' +import { Fragment } from 'react' export default function SessionsPage() { - const { query } = useRouter() - const address = (query?.address as string) ?? 'Unknown' - - useEffect(() => { - console.log(walletConnectClient.session.values) - }, []) + console.log(walletConnectClient.session.values) + console.log(walletConnectClient.session.history.pending) return ( - {truncate(address, 15)} + Sessions ) } diff --git a/wallets/react-wallet-v2/src/views/SessionSendTransactionModal.tsx b/wallets/react-wallet-v2/src/views/SessionSendTransactionModal.tsx index ba67f4b..c288576 100644 --- a/wallets/react-wallet-v2/src/views/SessionSendTransactionModal.tsx +++ b/wallets/react-wallet-v2/src/views/SessionSendTransactionModal.tsx @@ -174,7 +174,7 @@ export default function SessionSendTransactionModal() { Reject