diff --git a/packages/nextjs/app/bio/page.tsx b/packages/nextjs/app/bio/page.tsx index f50921d..7d1fcc8 100644 --- a/packages/nextjs/app/bio/page.tsx +++ b/packages/nextjs/app/bio/page.tsx @@ -5,8 +5,8 @@ import { InputTransactionData, useWallet } from "@aptos-labs/wallet-adapter-reac import type { NextPage } from "next"; import { InputBase } from "~~/components/scaffold-eth"; import deployedModules from "~~/contracts/deployedModules"; -import useSubmitTransaction from "~~/hooks/scaffold-move/useSubmitTransaction"; import { useGetAccountModules } from "~~/hooks/scaffold-move/useGetAccountModules"; +import useSubmitTransaction from "~~/hooks/scaffold-move/useSubmitTransaction"; import { aptosClient } from "~~/utils/scaffold-move/aptosClient"; const aptos = aptosClient("m1_devnet"); @@ -23,18 +23,15 @@ const OnchainBio: NextPage = () => { const [currentName, setCurrentName] = useState(null); const [currentBio, setCurrentBio] = useState(null); - const {data, isLoading, error} = useGetAccountModules(ONCHAIN_BIO.address); - + const { data, isLoading, error } = useGetAccountModules(ONCHAIN_BIO.address); - const {submitTransaction, transactionResponse, transactionInProcess} = - useSubmitTransaction(); + const { submitTransaction, transactionResponse, transactionInProcess } = useSubmitTransaction(); const fetchBio = async () => { if (!account) { return []; } try { - const resourceName = "Bio"; const bioResource = await aptos.getAccountResource({ accountAddress: account?.address, @@ -133,25 +130,19 @@ const OnchainBio: NextPage = () => { Fetch Bio - - {accountHasBio && !transactionInProcess && ( -
- Network:{" "} - {String(targetNetwork.name)} + Network: {String(targetNetwork.name)}
)} -- {fn.name} -
+{fn.name}
{fnParams.map((param, i) => { return (Result:
-{transactionResponse.success ? "✅ transaction successful" : "❌ transaction failed"}+
+ {transactionResponse.success ? "✅ transaction successful" : "❌ transaction failed"} +
Error: {error.type}
} - {error.message &&Error message: {error.message}
} - >; + return ( + <> + Cannot fetch resources. + {error.type &&Error: {error.type}
} + {error.message &&Error message: {error.message}
} + > + ); } if (!data?.length) { @@ -26,12 +24,8 @@ export const ModuleResources = ({ {data.map((resource, index) => (Connected Address:
- +@@ -57,10 +55,8 @@ const Home: NextPage = () => {
- Explore your local transactions with the{" "} - {/* */} - Block Explorer {" "} - {/* {" "} */} + Explore your local transactions with the {/* */} + Block Explorer {/* {" "} */} tab. Coming soon...