Skip to content

Commit b53b8bd

Browse files
committed
use rainbowkit connect button when connected
1 parent 0d51105 commit b53b8bd

File tree

1 file changed

+2
-27
lines changed
  • src/components/ConnectToEthereumButton

1 file changed

+2
-27
lines changed

src/components/ConnectToEthereumButton/index.tsx

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,17 @@
1-
import { FaChevronDown } from "react-icons/fa"
21
import { ConnectButton } from "@rainbow-me/rainbowkit"
32

43
import EthGlyphSolid from "@/components/icons/eth-glyph-solid.svg"
5-
import { Image } from "@/components/Image"
64
import { Button } from "@/components/ui/buttons/Button"
75

86
const ConnectToEthereumButton = ({ onClick }: { onClick: () => void }) => {
97
return (
108
<ConnectButton.Custom>
11-
{({ account, chain, openConnectModal, openAccountModal, mounted }) => {
9+
{({ account, chain, openConnectModal, mounted }) => {
1210
const ready = mounted
1311
if (!ready) return null
1412

1513
if (account && chain) {
16-
return (
17-
<Button
18-
onClick={openAccountModal}
19-
variant="ghost"
20-
className="rounded-2xl border-none bg-background p-0"
21-
>
22-
<p className="ps-2 text-sm font-bold text-body">
23-
{account.displayBalance}
24-
</p>
25-
<div className="flex h-full min-h-10 flex-row items-center rounded-2xl bg-background-highlight px-2">
26-
{account.ensAvatar && (
27-
<Image
28-
src={account.ensAvatar}
29-
alt={account.displayName}
30-
className="h-4 w-4 rounded-full"
31-
/>
32-
)}
33-
<p className="text-sm font-bold text-body">
34-
{account.displayName}
35-
</p>
36-
<FaChevronDown className="ms-2 text-body" />
37-
</div>
38-
</Button>
39-
)
14+
return <ConnectButton />
4015
}
4116

4217
return (

0 commit comments

Comments
 (0)