From e4b81be7860a01af1db2e5986c035c475ce3cdd7 Mon Sep 17 00:00:00 2001 From: Dawid Sowa Date: Mon, 27 May 2024 14:20:33 +0200 Subject: [PATCH] feat: open wallet's account list after linking --- src/components/linked-wallet/linked-wallet.tsx | 4 +++- src/components/linked-wallet/shared-accounts.tsx | 9 ++++++--- src/pairing/components/connection-status.tsx | 6 +++++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/linked-wallet/linked-wallet.tsx b/src/components/linked-wallet/linked-wallet.tsx index 2447afee..cff6a1d7 100644 --- a/src/components/linked-wallet/linked-wallet.tsx +++ b/src/components/linked-wallet/linked-wallet.tsx @@ -10,10 +10,12 @@ import { Account } from '@radixdlt/radix-dapp-toolkit' export const LinkedWallet = ({ name, accounts, + isJustLinked, onRenameWalletLink, onForgetWallet, }: { name: string + isJustLinked: boolean accounts: Account[] onRenameWalletLink: () => void onForgetWallet: () => void @@ -114,7 +116,7 @@ export const LinkedWallet = ({ - + ) } diff --git a/src/components/linked-wallet/shared-accounts.tsx b/src/components/linked-wallet/shared-accounts.tsx index c10584c7..ed40a801 100644 --- a/src/components/linked-wallet/shared-accounts.tsx +++ b/src/components/linked-wallet/shared-accounts.tsx @@ -2,10 +2,13 @@ import ChevronDown from './chevron-down.svg' import { Account as AccountType } from '@radixdlt/radix-dapp-toolkit' import { Account } from 'components/account/account' import { Box, Collapse } from '@mui/material' -import { useState } from 'react' +import { useEffect, useState } from 'react' -export const SharedAccounts = (props: { accounts?: AccountType[] }) => { - const [isCollapsed, setIsCollapsed] = useState(true) +export const SharedAccounts = (props: { + accounts?: AccountType[] + isJustLinked?: boolean +}) => { + const [isCollapsed, setIsCollapsed] = useState(!props.isJustLinked) return ( diff --git a/src/pairing/components/connection-status.tsx b/src/pairing/components/connection-status.tsx index ce4f145b..f2eb1ee3 100644 --- a/src/pairing/components/connection-status.tsx +++ b/src/pairing/components/connection-status.tsx @@ -17,12 +17,15 @@ export const ConnectionStatus = () => { const [changingName, setChangingName] = useState< { walletPublicKey: string; isInitial: boolean } | undefined >(undefined) + const [recentlyLinkedWallet, setRecentlyLinkedWallet] = useState< + string | undefined + >(undefined) useEffect(() => { if (searchParams.has('newWallet')) { const newWalletPublicKey = searchParams.get('newWallet') as string const isKnownWallet = searchParams.get('isKnownConnection') === 'true' - + setRecentlyLinkedWallet(newWalletPublicKey) setChangingName( !isKnownWallet ? { walletPublicKey: newWalletPublicKey, isInitial: true } @@ -93,6 +96,7 @@ export const ConnectionStatus = () => { {connectionsClient.entries().map(([id, connection]) => ( setConnectionIdToForget(id)}