1+ import { ArrowUpRightIcon } from "lucide-react" ;
2+ import Link from "next/link" ;
13import { isAddress } from "thirdweb" ;
24import { fetchDeployMetadata } from "thirdweb/contract" ;
35import { resolveAddress } from "thirdweb/extensions/ens" ;
68 fetchPublishedContractVersion ,
79 fetchPublishedContractVersions ,
810} from "@/api/contract/fetch-contracts-with-versions" ;
11+ import { DismissibleAlert } from "@/components/blocks/dismissible-alert" ;
12+ import { Badge } from "@/components/ui/badge" ;
13+ import { Button } from "@/components/ui/button" ;
914import { ZERO_FEE_VERSIONS } from "@/constants/fee-config" ;
1015import { serverThirdwebClient } from "@/constants/thirdweb-client.server" ;
1116import { PublishedContractBreadcrumbs } from "../[publisher]/[contract_id]/components/breadcrumbs.client" ;
@@ -95,6 +100,10 @@ export async function DeployFormForPublishInfo(props: PublishBasedDeployProps) {
95100 ) ,
96101 ] ) ;
97102
103+ const isTWPublisher =
104+ contractMetadata ?. publisher ===
105+ "0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024" ;
106+
98107 return (
99108 < div >
100109 < div className = "border-border border-b border-dashed" >
@@ -111,6 +120,23 @@ export async function DeployFormForPublishInfo(props: PublishBasedDeployProps) {
111120 />
112121 </ div >
113122
123+ { isTWPublisher &&
124+ ( contractMetadata . name === "DropERC20" ||
125+ contractMetadata . name === "TokenERC20" ) && (
126+ < TokenBanner type = "erc20" />
127+ ) }
128+ { isTWPublisher &&
129+ ( contractMetadata . name === "DropERC721" ||
130+ contractMetadata . name === "TokenERC721" ) && (
131+ < TokenBanner type = "erc721" />
132+ ) }
133+
134+ { isTWPublisher &&
135+ ( contractMetadata . name === "DropERC1155" ||
136+ contractMetadata . name === "TokenERC1155" ) && (
137+ < TokenBanner type = "erc1155" />
138+ ) }
139+
114140 < div className = "container max-w-5xl py-8" >
115141 < DeployFormForUri
116142 contractMetadata = { contractMetadata }
@@ -122,3 +148,49 @@ export async function DeployFormForPublishInfo(props: PublishBasedDeployProps) {
122148 </ div >
123149 ) ;
124150}
151+
152+ function TokenBanner ( props : { type : "erc20" | "erc721" | "erc1155" } ) {
153+ const title =
154+ props . type === "erc20"
155+ ? "Launch Your Token Effortlessly"
156+ : "Launch Your NFT Collection Effortlessly" ;
157+ const description =
158+ props . type === "erc20"
159+ ? "Deploy contract, set price and supply, airdrop tokens all in one seamless flow"
160+ : props . type === "erc721"
161+ ? "Deploy contract, upload NFTs, set price all in one seamless flow"
162+ : "Deploy contract, upload NFTs, set prices and supply all in one seamless flow" ;
163+ const href =
164+ props . type === "erc20"
165+ ? "/team/~/~project/tokens/create/token"
166+ : "/team/~/~project/tokens/create/nft" ;
167+
168+ return (
169+ < DismissibleAlert
170+ header = {
171+ < Badge
172+ variant = "outline"
173+ className = "bg-background gap-1.5 py-1 px-2.5 h-auto mb-3"
174+ >
175+ < div className = "rounded-full bg-primary size-1.5" />
176+ New
177+ </ Badge >
178+ }
179+ title = { title }
180+ className = "container max-w-5xl mt-8"
181+ preserveState = { false }
182+ description = { description }
183+ >
184+ < Button
185+ variant = "default"
186+ size = "sm"
187+ className = "gap-2 rounded-full mt-4 px-6"
188+ asChild
189+ >
190+ < Link href = { href } target = "_blank" >
191+ Try Now < ArrowUpRightIcon className = "size-3.5" />
192+ </ Link >
193+ </ Button >
194+ </ DismissibleAlert >
195+ ) ;
196+ }
0 commit comments