@@ -6,15 +6,19 @@ import { useAppKit, useWalletInfo } from '@reown/appkit/react';
66import EthSVG from '@/assets/eth.svg?react' ;
77import { FormattedBalance , Skeleton } from '@/components' ;
88import { useEthAccount , useEthAccountBalance , useModal , useVaraAccountBalance , useVaraSymbol } from '@/hooks' ;
9- import { getTruncatedText , isUndefined } from '@/utils' ;
9+ import { cx , getTruncatedText , isUndefined } from '@/utils' ;
1010
1111import WalletSVG from '../../assets/wallet.svg?react' ;
1212import { WALLET_SVGS } from '../../consts' ;
1313import { NetworkWalletModal } from '../network-wallet-modal' ;
1414
1515import styles from './wallet.module.scss' ;
1616
17- function Wallet ( ) {
17+ type Props = {
18+ className ?: string ;
19+ } ;
20+
21+ function Wallet ( { className } : Props ) {
1822 const { api } = useApi ( ) ;
1923 const { account, isAccountReady } = useAccount ( ) ;
2024 const varaAccountBalance = useVaraAccountBalance ( ) ;
@@ -37,7 +41,7 @@ function Wallet() {
3741 // it's probably worth to check isConnecting too, but there is a bug:
3842 // no extensions -> open any wallet's QR code -> close modal -> isConnecting is still true
3943 if ( ! isAccountReady || ethAccount . isReconnecting || ! api || ! varaSymbol )
40- return < Skeleton width = "11rem" height = "2rem" className = { styles . skeleton } /> ;
44+ return < Skeleton width = "11rem" height = "2rem" className = { className } /> ;
4145
4246 const address = account ?. address || ethAccount . address ;
4347 const balance = account ? varaAccountBalance : ethAccountBalance ;
@@ -47,7 +51,7 @@ function Wallet() {
4751 return (
4852 < >
4953 { address ? (
50- < button type = "button" className = { styles . wallet } onClick = { handleButtonClick } >
54+ < button type = "button" className = { cx ( styles . wallet , className ) } onClick = { handleButtonClick } >
5155 { ! isUndefined ( balance . data ) ? (
5256 < span className = { styles . balance } >
5357 < WalletSVG />
@@ -67,7 +71,7 @@ function Wallet() {
6771 </ span >
6872 </ button >
6973 ) : (
70- < Button text = "Connect Wallet" size = "x-small" onClick = { openModal } className = { styles . button } />
74+ < Button text = "Connect Wallet" size = "x-small" onClick = { openModal } className = { className } />
7175 ) }
7276
7377 { isModalOpen && < NetworkWalletModal close = { closeModal } /> }
0 commit comments