diff --git a/CHANGELOG.md b/CHANGELOG.md
index 84f7a334a..54c80d3cd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -75,6 +75,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Bug fixes
+- [#395](https://github.com/alleslabs/celatone-frontend/pull/395) Disable wasm related tabs on the account detail page
- [#392](https://github.com/alleslabs/celatone-frontend/pull/392) Fix format denom function
- [#390](https://github.com/alleslabs/celatone-frontend/pull/390) Fix minor styling
- [#391](https://github.com/alleslabs/celatone-frontend/pull/391) Fix incorrect empty state for past txs table
diff --git a/src/lib/pages/account-details/index.tsx b/src/lib/pages/account-details/index.tsx
index 1cc2c2a31..7a9b62415 100644
--- a/src/lib/pages/account-details/index.tsx
+++ b/src/lib/pages/account-details/index.tsx
@@ -11,7 +11,7 @@ import {
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
-import { useValidateAddress } from "lib/app-provider";
+import { useValidateAddress, useWasmConfig } from "lib/app-provider";
import { Breadcrumb } from "lib/components/Breadcrumb";
import { CopyLink } from "lib/components/CopyLink";
import { CustomTab } from "lib/components/CustomTab";
@@ -63,6 +63,8 @@ interface AccountDetailsBodyProps {
const InvalidAccount = () => ;
const AccountDetailsBody = ({ accountAddress }: AccountDetailsBodyProps) => {
+ const wasm = useWasmConfig({ shouldRedirect: false });
+
const [tabIndex, setTabIndex] = useState(TabIndex.Overview);
const tableHeaderId = "accountDetailsTab";
const { data: publicInfo } = usePublicProjectByAccountAddress(accountAddress);
@@ -156,7 +158,7 @@ const AccountDetailsBody = ({ accountAddress }: AccountDetailsBodyProps) => {
)}
-
+
{
count={tableCounts.codesCount}
isDisabled={!tableCounts.codesCount}
onClick={() => handleTabChange(TabIndex.Codes)}
+ hidden={!wasm.enabled}
>
Codes
@@ -194,6 +197,7 @@ const AccountDetailsBody = ({ accountAddress }: AccountDetailsBodyProps) => {
count={tableCounts.contractsCount}
isDisabled={!tableCounts.contractsCount}
onClick={() => handleTabChange(TabIndex.Contracts)}
+ hidden={!wasm.enabled}
>
Contracts
@@ -201,6 +205,7 @@ const AccountDetailsBody = ({ accountAddress }: AccountDetailsBodyProps) => {
count={tableCounts.contractsAdminCount}
isDisabled={!tableCounts.contractsAdminCount}
onClick={() => handleTabChange(TabIndex.Admins)}
+ hidden={!wasm.enabled}
>
Admins
@@ -258,27 +263,31 @@ const AccountDetailsBody = ({ accountAddress }: AccountDetailsBodyProps) => {
scrollComponentId={tableHeaderId}
onViewMore={() => handleTabChange(TabIndex.Txs)}
/>
- handleTabChange(TabIndex.Codes)}
- />
- handleTabChange(TabIndex.Contracts)}
- />
- handleTabChange(TabIndex.Admins)}
- />
+ {wasm.enabled && (
+ <>
+ handleTabChange(TabIndex.Codes)}
+ />
+ handleTabChange(TabIndex.Contracts)}
+ />
+ handleTabChange(TabIndex.Admins)}
+ />
+ >
+ )}
=> {
const { indexerGraphClient } = useCelatoneApp();
+ const wasm = useWasmConfig({ shouldRedirect: false });
+
const queryFn = useCallback(async () => {
if (!walletAddress)
throw new Error(
@@ -202,7 +204,11 @@ export const useCodeListByWalletAddressPagination = (
walletAddress,
],
createQueryFnWithTimeout(queryFn),
- { enabled: !!walletAddress, retry: 1, refetchOnWindowFocus: false }
+ {
+ enabled: wasm.enabled && !!walletAddress,
+ retry: 1,
+ refetchOnWindowFocus: false,
+ }
);
};
@@ -210,6 +216,8 @@ export const useCodeListCountByWalletAddress = (
walletAddress: Option
): UseQueryResult