Skip to content

Commit 5ed08c2

Browse files
fix(frontend): tokens page wallet button align (#746)
1 parent 2f61c4e commit 5ed08c2

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

js/frontend/src/components/layout/header/header.module.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
}
2121
}
2222

23+
.wallet {
24+
margin-left: auto;
25+
}
26+
2327
.nav {
2428
padding: 8px 0;
2529

js/frontend/src/components/layout/header/header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function Header() {
7575

7676
<NetworkSwitch />
7777

78-
<Wallet />
78+
<Wallet className={styles.wallet} />
7979
</Container>
8080

8181
<nav className={styles.nav}>

js/frontend/src/features/wallet/components/wallet/wallet.module.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
.wallet,
2-
.button,
3-
.skeleton {
4-
margin-left: auto;
5-
}
6-
71
.wallet {
82
display: flex;
93
gap: 12px;

js/frontend/src/features/wallet/components/wallet/wallet.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ import { useAppKit, useWalletInfo } from '@reown/appkit/react';
66
import EthSVG from '@/assets/eth.svg?react';
77
import { FormattedBalance, Skeleton } from '@/components';
88
import { useEthAccount, useEthAccountBalance, useModal, useVaraAccountBalance, useVaraSymbol } from '@/hooks';
9-
import { getTruncatedText, isUndefined } from '@/utils';
9+
import { cx, getTruncatedText, isUndefined } from '@/utils';
1010

1111
import WalletSVG from '../../assets/wallet.svg?react';
1212
import { WALLET_SVGS } from '../../consts';
1313
import { NetworkWalletModal } from '../network-wallet-modal';
1414

1515
import 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

Comments
 (0)