diff --git a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/embed/embed-setup.tsx b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/embed/embed-setup.tsx index 9bbc1cb35d2..ac759a49730 100644 --- a/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/embed/embed-setup.tsx +++ b/apps/dashboard/src/app/(dashboard)/(chain)/[chain_id]/[contractAddress]/embed/embed-setup.tsx @@ -1,5 +1,6 @@ "use client"; +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; import { CodeClient } from "@/components/ui/code/code.client"; import { @@ -11,8 +12,7 @@ import { Flex, FormControl, Input, Select } from "@chakra-ui/react"; import { LazyCreateAPIKeyDialog } from "components/settings/ApiKeys/Create/LazyCreateAPIKeyDialog"; import { useTrack } from "hooks/analytics/useTrack"; import { useAllChainsData } from "hooks/chains/allChains"; -import { useClipboard } from "hooks/useClipboard"; -import { CheckIcon, CopyIcon } from "lucide-react"; +import { AlertCircleIcon } from "lucide-react"; import { useTheme } from "next-themes"; import Link from "next/link"; import { usePathname } from "next/navigation"; @@ -300,13 +300,12 @@ export const EmbedSetup: React.FC = ({ [iframeSrc], ); - const { hasCopied, onCopy } = useClipboard(embedCode, 3000); const [showCreateAPIKeyModal, setShowCreateAPIKeyModal] = useState(false); const activeAccount = useActiveAccount(); const pathname = usePathname(); return ( - +
= ({ enableNebulaServiceByDefault={false} /> - - - Configuration + + + Deprecated + + + thirdweb NFT Embeds are deprecated and not actively maintained + {" "} +
+ + Use the{" "} + + {" "} + NFT Minting Template + {" "} + or build a custom NFT minting app using{" "} + + thirdweb React SDK components + {" "} + instead + +
+
+ +
+ +
+
+

+ Configuration +

+ + + {ercOrMarketplace === "marketplace" ? ( + + Listing ID + + + The listing ID the embed should display + + + ) : null} + + {ercOrMarketplace === "marketplace-v3" ? ( + + Listing type + + + The type of listing the embed should display + + + ) : null} + + {ercOrMarketplace === "marketplace-v3" && + watch("listingType") === "direct-listing" ? ( + + Direct Listing ID + + + The direct listing ID the embed should display + + + ) : null} + + {ercOrMarketplace === "marketplace-v3" && + watch("listingType") === "english-auction" ? ( + + English Auction ID + + + The english auction ID the embed should display + + + ) : null} + + {ercOrMarketplace === "erc1155" ? ( + + Token ID + + + The token ID the embed should display + + + ) : null} - {ercOrMarketplace === "marketplace" ? ( - Listing ID - - - The listing ID the embed should display - - - ) : null} - - {ercOrMarketplace === "marketplace-v3" ? ( - - Listing type - - - The type of listing the embed should display - - - ) : null} - - {ercOrMarketplace === "marketplace-v3" && - watch("listingType") === "direct-listing" ? ( - - Direct Listing ID - - - The direct listing ID the embed should display - - - ) : null} + Client ID + {!activeAccount ? ( + + ) : validApiKey ? ( + + ) : ( + + )} - {ercOrMarketplace === "marketplace-v3" && - watch("listingType") === "english-auction" ? ( - - English Auction ID - - The english auction ID the embed should display + You need a client ID to use embeds.{" "} + + Learn more + + . - ) : null} - {ercOrMarketplace === "erc1155" ? ( - Token ID - + RPC Url + - The token ID the embed should display + RPC the embed should use to connect to the blockchain. - ) : null} - - Client ID - {!activeAccount ? ( - - ) : validApiKey ? ( - - ) : ( - + {ercOrMarketplace === "marketplace" || + ercOrMarketplace === "marketplace-v3" ? null : ( + + + Gasless + + + {watch("gasless") === "openZeppelin" && ( + + OpenZeppelin Relayer URL + + + )} + {watch("gasless") === "biconomy" && ( + + + Biconomy API key + + + + Biconomy API ID + + + + )} + + A relayer can be used to make the transaction gasless for the + end user.{" "} + + Learn more + + + )} - - You need a client ID to use embeds.{" "} - - Learn more - - . - - - - - RPC Url - - - RPC the embed should use to connect to the blockchain. - - - - {ercOrMarketplace === "marketplace" || - ercOrMarketplace === "marketplace-v3" ? null : ( - - - Gasless - - + + + - {watch("gasless") === "openZeppelin" && ( - - OpenZeppelin Relayer URL - - - )} - {watch("gasless") === "biconomy" && ( - - - Biconomy API key - - - - Biconomy API ID - - - - )} - A relayer can be used to make the transaction gasless for the - end user.{" "} - - Learn more - + Selecting system will make it so the embed would change + depending on the user system's preferences. - )} - - - - Customization - - Theme - - - Selecting system will make it so the embed would change depending - on the user system's preferences. - - - - - Primary Color - - - Used for the main actions button backgrounds. - - - - {ercOrMarketplace === "marketplace" || - ercOrMarketplace === "marketplace-v3" ? ( + - Secondary Color - + {ercOrMarketplace === "erc721" && ( + + )} {colorOptions.map((color) => ( - ) : null} - - - - Embed Code - -
+ +
+

+ Embed Code +

+ { trackEvent({ category: "embed", action: "click", @@ -554,19 +586,15 @@ export const EmbedSetup: React.FC = ({ chainId, }); }} - > - {hasCopied ? ( - - ) : ( - - )} - {hasCopied ? "Copied!" : "Copy to clipboard"} - - - + /> +
+
+ +
+ +

Preview

-
- Preview +
{!validApiKey ? ( You need to create a client ID to use embeds ) : iframeSrc ? ( @@ -579,6 +607,6 @@ export const EmbedSetup: React.FC = ({ /> ) : null}
- +
); };