Skip to content

Commit f3a8124

Browse files
committed
feat: hide WalletSelect if only 1 account is connected
1 parent 4d8e7e5 commit f3a8124

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

packages/wallet-widget/src/views/Send/SendCoin.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {
55
ExtendedConnector,
66
truncateAtMiddle,
77
useCheckWaasFeeOptions,
8-
useWaasFeeOptions
8+
useWaasFeeOptions,
9+
useWallets
910
} from '@0xsequence/connect'
1011
import {
1112
Button,
@@ -41,6 +42,7 @@ interface SendCoinProps {
4142

4243
export const SendCoin = ({ chainId, contractAddress }: SendCoinProps) => {
4344
const toast = useToast()
45+
const { wallets } = useWallets()
4446
const { setNavigation } = useNavigation()
4547
const { setIsBackButtonEnabled } = useNavigationContext()
4648
const { analytics } = useAnalyticsContext()
@@ -337,7 +339,7 @@ export const SendCoin = ({ chainId, contractAddress }: SendCoinProps) => {
337339
/>
338340
}
339341
/>
340-
<WalletSelect selectedWallet={toAddress} onClick={setToAddress} />
342+
{wallets.length > 1 && <WalletSelect selectedWallet={toAddress} onClick={setToAddress} />}
341343
</>
342344
)}
343345
</div>

packages/wallet-widget/src/views/Send/SendCollectible.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import {
44
ExtendedConnector,
55
truncateAtMiddle,
66
useCheckWaasFeeOptions,
7-
useWaasFeeOptions
7+
useWaasFeeOptions,
8+
useWallets
89
} from '@0xsequence/connect'
910
import {
1011
Button,
@@ -43,6 +44,7 @@ interface SendCollectibleProps {
4344

4445
export const SendCollectible = ({ chainId, contractAddress, tokenId }: SendCollectibleProps) => {
4546
const toast = useToast()
47+
const { wallets } = useWallets()
4648
const { setNavigation } = useNavigation()
4749
const { setIsBackButtonEnabled } = useNavigationContext()
4850
const { analytics } = useAnalyticsContext()
@@ -395,7 +397,7 @@ export const SendCollectible = ({ chainId, contractAddress, tokenId }: SendColle
395397
/>
396398
}
397399
/>
398-
<WalletSelect selectedWallet={toAddress} onClick={setToAddress} />
400+
{wallets.length > 1 && <WalletSelect selectedWallet={toAddress} onClick={setToAddress} />}
399401
</>
400402
)}
401403
</div>

packages/wallet-widget/src/views/Swap/Swap.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const Swap = () => {
7979
</Text>
8080
) : (
8181
<Text className="mt-2" variant="normal" color="negative">
82-
Something went wrong. Please try again later.
82+
Something went wrong. Try again later or with a different combination of coins.
8383
</Text>
8484
))}
8585

0 commit comments

Comments
 (0)