diff --git a/src/components/names/NameList.tsx b/src/components/names/NameList.tsx index 25ca0a6..894758b 100644 --- a/src/components/names/NameList.tsx +++ b/src/components/names/NameList.tsx @@ -35,7 +35,7 @@ export const NameList = () => { return (
-
Vaults
+
All Names
{/* {address && } */}
diff --git a/src/components/vaults/VaultEntry.tsx b/src/components/vaults/VaultEntry.tsx index 501b5e2..6aa339b 100644 --- a/src/components/vaults/VaultEntry.tsx +++ b/src/components/vaults/VaultEntry.tsx @@ -1,21 +1,37 @@ +/* eslint-disable jsx-a11y/no-static-element-interactions */ +/* eslint-disable jsx-a11y/click-events-have-key-events */ +import { VaultInfo } from "components/modals/VaultInfo"; import { formatAddress } from "ens-tools"; -import { FC } from "react"; -import { Vault } from "types/vault"; +import { useVaultBalance } from "hooks/useVaultBalance"; +import { useVaultOwner } from "hooks/useVaultOwner"; +import { FC, useState } from "react"; import { useEnsName } from "wagmi"; -export const VaultEntry: FC<{ vault: Vault }> = ({ vault }) => { - const { data: name } = useEnsName({ address: vault.owner as "0x{string}" }); +export const VaultEntry: FC<{ vault: bigint }> = ({ vault }) => { + const { data: owner } = useVaultOwner(vault); + const { data: name } = useEnsName({ address: owner }); + const { data: balance } = useVaultBalance(vault); + + const [isOpen, setIsOpen] = useState(false); return ( -
-
-
{formatAddress(vault.address)}
-
{name || formatAddress(vault.owner)}
-
-
-
{vault.name_count} names
-
{vault.balance} ETH
+
+
setIsOpen(true)} + > +
+
{vault.toString()}
+
{name || formatAddress(owner || "")}
+
+
+ {/*
{vault.name_count} names
*/} +
{balance} ETH
+
+ {isOpen && ( + setIsOpen(false)} /> + )}
); }; diff --git a/src/types/vault.ts b/src/types/vault.ts deleted file mode 100644 index 8a97179..0000000 --- a/src/types/vault.ts +++ /dev/null @@ -1,6 +0,0 @@ -export type Vault = { - address: string; - owner: string; - balance: string; - name_count: number; -};