-
Published by
-
+
+
Published by
-
-
- }
- loadingComponent={
}
- />
-
-
-
+
+
{ensQuery.data?.ensName}
- ) : (
-
- shortenIfAddress(replaceDeployerAddress(addr))
- }
- />
- )
+
+ }
+ loadingComponent={
+
}
- formatFn={(name) => replaceDeployerAddress(name)}
- loadingComponent={}
/>
-
+
+
+
+
+
+ {ensQuery.data?.ensName}
+
+ ) : (
+
+ shortenIfAddress(replaceDeployerAddress(addr))
+ }
+ />
+ )
+ }
+ formatFn={(name) => replaceDeployerAddress(name)}
+ loadingComponent={}
+ />
+
+
+
+ View all published contracts{" "}
+
+
+
-
-
);
};
diff --git a/apps/dashboard/src/@/components/contracts/published-contract/index.tsx b/apps/dashboard/src/@/components/contracts/published-contract/index.tsx
index c285f55ecba..bf7d93a0752 100644
--- a/apps/dashboard/src/@/components/contracts/published-contract/index.tsx
+++ b/apps/dashboard/src/@/components/contracts/published-contract/index.tsx
@@ -1,11 +1,6 @@
"use client";
-import { Divider, Flex, GridItem, List, ListItem } from "@chakra-ui/react";
import { useQuery } from "@tanstack/react-query";
-import { LinkButton } from "chakra/button";
-import { Card } from "chakra/card";
-import { Heading } from "chakra/heading";
-import { Text } from "chakra/text";
import { format } from "date-fns";
import {
BookOpenTextIcon,
@@ -26,15 +21,15 @@ import { MarkdownRenderer } from "@/components/blocks/markdown-renderer";
import type { PublishedContractWithVersion } from "@/components/contract-components/fetch-contracts-with-versions";
import { ContractFunctionsOverview } from "@/components/contracts/functions/contract-functions";
import { Button } from "@/components/ui/button";
-import { Separator } from "@/components/ui/separator";
import {
usePublishedContractEvents,
usePublishedContractFunctions,
} from "@/hooks/contract-hooks";
import { correctAndUniqueLicenses } from "@/lib/licenses";
import { replaceIpfsUrl } from "@/lib/sdk";
+import { cn } from "@/lib/utils";
-interface ExtendedPublishedContract extends PublishedContractWithVersion {
+type ExtendedPublishedContract = PublishedContractWithVersion & {
name: string;
displayName?: string;
description?: string;
@@ -43,19 +38,19 @@ interface ExtendedPublishedContract extends PublishedContractWithVersion {
tags?: string[];
logo?: string;
audit?: string;
-}
-
-interface PublishedContractProps {
- publishedContract: ExtendedPublishedContract;
- isLoggedIn: boolean;
- client: ThirdwebClient;
-}
+};
-export const PublishedContract: React.FC
= ({
+export function PublishedContract({
publishedContract,
isLoggedIn,
client,
-}) => {
+ className,
+}: {
+ publishedContract: ExtendedPublishedContract;
+ isLoggedIn: boolean;
+ client: ThirdwebClient;
+ className?: string;
+}) {
const address = useActiveAccount()?.address;
const contractFunctions = usePublishedContractFunctions(publishedContract);
@@ -108,162 +103,181 @@ export const PublishedContract: React.FC = ({
);
return (
- <>
-
-
- {address === publishedContract.publisher && (
- }
- ml="auto"
- size="sm"
+
+ {/* left */}
+
+ {address === publishedContract.publisher && (
+
+
+
+ )}
- {publishedContract?.changelog && (
-
-
- {publishedContract?.version} Release Notes
-
-
+ {/* readme */}
+ {publishedContract?.readme && (
+
+
+
+ )}
-
-
- )}
- {contractFunctions && (
-
+
+
+ {publishedContract?.version} Release Notes
+
+
+
+
+ )}
+
+ {contractFunctions && (
+
+ )}
+
+
+ {/* right */}
+
+ {publishedContract.publisher && (
+
+ )}
+
+
+
+
+ {/* timestamp */}
+ {publishedContract.publishTimestamp && (
+ -
+
+
+
+
+
+ Publish Date
+
+
+ {publishDate}
+
+
+
)}
-
-
-
-
- {publishedContract.publisher && (
-
+ {/* audit */}
+ {publishedContract?.audit && (
+ -
+
+
+
+
+
+
+ Audit Report
+
+
+ View Audit Report
+
+
+
+
+
)}
-
+ {/* license */}
+ -
+
+
+
+
+
+ License{licenses.length > 1 ? "s" : ""}
+
+
+ {licenses.join(", ") || "None"}
+
+
+
-
-
Details
-
- {publishedContract.publishTimestamp && (
-
-
-
-
-
- Publish Date
-
-
- {publishDate}
-
-
-
-
- )}
- {publishedContract?.audit && (
-
-
-
-
-
- Audit Report
-
-
-
- View Audit Report
-
-
-
-
-
- )}
-
-
-
-
-
- License
- {licenses.length > 1 ? "s" : ""}
-
-
- {licenses.join(", ") || "None"}
-
-
-
-
- {(publishedContract?.isDeployableViaProxy &&
- hasImplementationAddresses) ||
- (publishedContract?.isDeployableViaFactory &&
- hasFactoryAddresses) ? (
-
-
-
-
-
- {publishedContract?.isDeployableViaFactory
- ? "Factory"
- : "Proxy"}{" "}
- Enabled
-
-
-
-
- ) : null}
-
-
+ {(publishedContract?.isDeployableViaProxy &&
+ hasImplementationAddresses) ||
+ (publishedContract?.isDeployableViaFactory && hasFactoryAddresses) ? (
+ -
+
+
+
+
+ {publishedContract?.isDeployableViaFactory
+ ? "Factory"
+ : "Proxy"}{" "}
+ Enabled
+
+
+ ) : null}
+
-
+
-
-
-
- >
+
+
+
);
-};
+}
-// TODO: find a place to put this
type ContractSource = {
filename: string;
source: string;
};
+
async function fetchSourceFilesFromMetadata(
publishedMetadata: ExtendedPublishedContract,
client: ThirdwebClient,
diff --git a/apps/dashboard/src/@/utils/shareLink.ts b/apps/dashboard/src/@/utils/shareLink.ts
deleted file mode 100644
index 5471b227127..00000000000
--- a/apps/dashboard/src/@/utils/shareLink.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-import { toast } from "sonner";
-
-// if browser supports sharing use native sharing - use that, else just copy to clipboard + show toast
-export async function shareLink(_data: ShareData) {
- const data = { ..._data, url: _data.url || window.location.href };
-
- if (
- "canShare" in navigator &&
- navigator.canShare &&
- navigator.canShare(data)
- ) {
- await navigator.share(data);
- } else {
- await navigator.clipboard.writeText(data.url);
- toast.info("URL copied to clipboard");
- }
-}
diff --git a/apps/dashboard/src/app/(app)/(dashboard)/explore/page.tsx b/apps/dashboard/src/app/(app)/(dashboard)/explore/page.tsx
index 7627635c64e..4309e08463c 100644
--- a/apps/dashboard/src/app/(app)/(dashboard)/explore/page.tsx
+++ b/apps/dashboard/src/app/(app)/(dashboard)/explore/page.tsx
@@ -21,16 +21,20 @@ export const metadata: Metadata = {
export default async function ExplorePage() {
return (
-
-
- Explore
-
-
- The best place for web3 developers to explore smart contracts from
- world-class web3 protocols & engineers — all deployable with one
- click.
-
-
+
+
+
+ Explore
+
+
+ The best place for web3 developers to explore smart contracts from
+ world-class web3 protocols & engineers — all deployable with one
+ click.
+
+
+
+
+
{EXPLORE_PAGE_DATA.map((category, idx) => (
@@ -42,7 +46,6 @@ export default async function ExplorePage() {
))}
-
diff --git a/apps/dashboard/src/app/(app)/(dashboard)/published-contract/[publisher]/[contract_id]/[version]/page.tsx b/apps/dashboard/src/app/(app)/(dashboard)/published-contract/[publisher]/[contract_id]/[version]/page.tsx
index a54fe3e4958..8f9e5d48405 100644
--- a/apps/dashboard/src/app/(app)/(dashboard)/published-contract/[publisher]/[contract_id]/[version]/page.tsx
+++ b/apps/dashboard/src/app/(app)/(dashboard)/published-contract/[publisher]/[contract_id]/[version]/page.tsx
@@ -1,16 +1,14 @@
-import { SimpleGrid } from "@chakra-ui/react";
-import { ChakraProviderSetup } from "chakra/ChakraProviderSetup";
import { notFound } from "next/navigation";
import { isAddress } from "thirdweb";
import { resolveAddress } from "thirdweb/extensions/ens";
import { getUserThirdwebClient } from "@/api/auth-token";
import { fetchPublishedContractVersions } from "@/components/contract-components/fetch-contracts-with-versions";
import { PublishedContract } from "@/components/contracts/published-contract";
-import { Separator } from "@/components/ui/separator";
import { serverThirdwebClient } from "@/constants/thirdweb-client.server";
import { getRawAccount } from "../../../../../account/settings/getAccount";
import { PublishedActions } from "../../../components/contract-actions-published.client";
import { DeployContractHeader } from "../../../components/contract-header";
+import { PublishedContractBreadcrumbs } from "../components/breadcrumbs.client";
function mapThirdwebPublisher(publisher: string) {
if (publisher === "thirdweb.eth") {
@@ -75,28 +73,33 @@ export default async function PublishedContractPage(
]);
return (
- <>
-
-
+
+
+
+
-
-
- {/* TODO: remove the chakra things :) */}
-
-
-
+
-
-
- >
+
+
+
+
+
);
}
diff --git a/apps/dashboard/src/app/(app)/(dashboard)/published-contract/[publisher]/[contract_id]/components/breadcrumbs.client.tsx b/apps/dashboard/src/app/(app)/(dashboard)/published-contract/[publisher]/[contract_id]/components/breadcrumbs.client.tsx
index 8f314800f91..85b7f0c1a99 100644
--- a/apps/dashboard/src/app/(app)/(dashboard)/published-contract/[publisher]/[contract_id]/components/breadcrumbs.client.tsx
+++ b/apps/dashboard/src/app/(app)/(dashboard)/published-contract/[publisher]/[contract_id]/components/breadcrumbs.client.tsx
@@ -13,13 +13,14 @@ import {
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";
+import { cn } from "@/lib/utils";
-export function PublishedContractBreadcrumbs() {
+export function PublishedContractBreadcrumbs(props: { className?: string }) {
const pathname = usePathname() || "";
const segments = pathname.split("/").filter((segment) => segment !== "");
return (
-