Skip to content

Commit 01a540d

Browse files
kemurujaybuidl
authored andcommitted
fix(web): add disconnect wallet button to navbar
1 parent e2e0943 commit 01a540d

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

web/src/components/ConnectWallet/AccountDisplay.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import { shortenAddress } from "utils/shortenAddress";
66

77
const Container = styled.div`
88
display: flex;
9-
flex-direction: row;
10-
justify-content: space-between;
11-
align-content: center;
12-
align-items: center;
9+
flex-direction: column;
10+
align-items: flex-start;
11+
gap: 8px;
1312
`;
1413

1514
const AccountContainer = styled.div`

web/src/components/ConnectWallet/index.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
import React from "react";
2+
import styled from "styled-components";
23
import { useAccount, useNetwork, useSwitchNetwork } from "wagmi";
34
import { useWeb3Modal } from "@web3modal/react";
45
import { Button } from "@kleros/ui-components-library";
56
import { SUPPORTED_CHAINS, DEFAULT_CHAIN } from "consts/chains";
67
import AccountDisplay from "./AccountDisplay";
8+
import { DisconnectWalletButton } from "layout/Header/navbar/Menu/Settings/General";
9+
10+
const Container = styled.div`
11+
display: flex;
12+
gap: 16px;
13+
justify-content: space-between;
14+
flex-wrap: wrap;
15+
`;
716

817
export const SwitchChainButton: React.FC = () => {
918
const { switchNetwork, isLoading } = useSwitchNetwork();
@@ -39,7 +48,13 @@ const ConnectWallet: React.FC = () => {
3948
if (isConnected) {
4049
if (chain && chain.id !== DEFAULT_CHAIN) {
4150
return <SwitchChainButton />;
42-
} else return <AccountDisplay />;
51+
} else
52+
return (
53+
<Container>
54+
<AccountDisplay />
55+
<DisconnectWalletButton />
56+
</Container>
57+
);
4358
} else return <ConnectButton />;
4459
};
4560

0 commit comments

Comments
 (0)