Skip to content

Commit a5ffc54

Browse files
committed
Fix error thrown from PublishedBy card on localhost chain (#5198)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on refactoring the `ContractOverviewPageClient` component by removing the `PublishedByClient` function and its associated logic, while setting the `publishedBy` prop to `undefined`. This prepares for a future implementation of a fully client-rendered version. ### Detailed summary - Removed the import statements for `useThirdwebClient`, `useQuery`, and `useActiveAccount`. - Deleted the `PublishedByClient` function and its logic. - Updated the `publishedBy` prop in `ContractOverviewPageClient` to `undefined`. - Added a TODO comment for future implementation of a fully client-rendered version of `publishedBy` and `ContractCard`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 286aa30 commit a5ffc54

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
"use client";
2-
3-
import { useThirdwebClient } from "@/constants/thirdweb.client";
4-
import { useQuery } from "@tanstack/react-query";
52
import type { ThirdwebContract } from "thirdweb";
63
import type { ChainMetadata } from "thirdweb/chains";
7-
import { useActiveAccount } from "thirdweb/react";
84
import { ErrorPage, LoadingPage } from "../_components/page-skeletons";
95
import { useContractPageMetadata } from "../_hooks/useContractPageMetadata";
106
import { ContractOverviewPage } from "./ContractOverviewPage";
11-
import {
12-
PublishedByUI,
13-
getPublishedByCardProps,
14-
} from "./components/published-by-ui";
157

168
export function ContractOverviewPageClient(props: {
179
contract: ThirdwebContract;
@@ -44,30 +36,8 @@ export function ContractOverviewPageClient(props: {
4436
chainSlug={chainMetadata.slug}
4537
isAnalyticsSupported={contractPageMetadata.isAnalyticsSupported}
4638
functionSelectors={contractPageMetadata.functionSelectors}
47-
// TODO
48-
publishedBy={<PublishedByClient contract={props.contract} />}
39+
// TODO - create a fully client rendered version of publishedBy and ContractCard and plug it here
40+
publishedBy={undefined}
4941
/>
5042
);
5143
}
52-
53-
function PublishedByClient(props: {
54-
contract: ThirdwebContract;
55-
}) {
56-
const client = useThirdwebClient();
57-
const address = useActiveAccount()?.address;
58-
const propsQuery = useQuery({
59-
queryKey: ["getPublishedByCardProps", props],
60-
queryFn: () =>
61-
getPublishedByCardProps({
62-
address: address || null,
63-
client: client,
64-
contract: props.contract,
65-
}),
66-
});
67-
68-
if (!propsQuery.data) {
69-
return null;
70-
}
71-
72-
return <PublishedByUI {...propsQuery.data} />;
73-
}

0 commit comments

Comments
 (0)