Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
"use client";

import { useThirdwebClient } from "@/constants/thirdweb.client";
import { useQuery } from "@tanstack/react-query";
import type { ThirdwebContract } from "thirdweb";
import type { ChainMetadata } from "thirdweb/chains";
import { useActiveAccount } from "thirdweb/react";
import { ErrorPage, LoadingPage } from "../_components/page-skeletons";
import { useContractPageMetadata } from "../_hooks/useContractPageMetadata";
import { ContractOverviewPage } from "./ContractOverviewPage";
import {
PublishedByUI,
getPublishedByCardProps,
} from "./components/published-by-ui";

export function ContractOverviewPageClient(props: {
contract: ThirdwebContract;
Expand Down Expand Up @@ -44,30 +36,8 @@ export function ContractOverviewPageClient(props: {
chainSlug={chainMetadata.slug}
isAnalyticsSupported={contractPageMetadata.isAnalyticsSupported}
functionSelectors={contractPageMetadata.functionSelectors}
// TODO
publishedBy={<PublishedByClient contract={props.contract} />}
// TODO - create a fully client rendered version of publishedBy and ContractCard and plug it here
publishedBy={undefined}
/>
);
}

function PublishedByClient(props: {
contract: ThirdwebContract;
}) {
const client = useThirdwebClient();
const address = useActiveAccount()?.address;
const propsQuery = useQuery({
queryKey: ["getPublishedByCardProps", props],
queryFn: () =>
getPublishedByCardProps({
address: address || null,
client: client,
contract: props.contract,
}),
});

if (!propsQuery.data) {
return null;
}

return <PublishedByUI {...propsQuery.data} />;
}
Loading