diff --git a/src/components/NavbarWallet.tsx b/src/components/NavbarWallet.tsx new file mode 100644 index 0000000..7c909a6 --- /dev/null +++ b/src/components/NavbarWallet.tsx @@ -0,0 +1,46 @@ +"use client"; + +import { useState } from "react"; + +/** Navbar wallet button + network switcher (GFI). */ +export function NavbarWallet({ + address, + network, + networks = ["TESTNET", "PUBLIC"], + onConnect, + onSwitchNetwork, +}: { + address?: string | null; + network?: string | null; + networks?: string[]; + onConnect?: () => void; + onSwitchNetwork?: (n: string) => void; +}) { + const [open, setOpen] = useState(false); + const short = address ? `${address.slice(0, 4)}…${address.slice(-4)}` : null; + return ( +
+ + {address ? ( + + ) : null} + {open && address ? ( +
+ {address} +
+ ) : null} +
+ ); +}