@@ -114,6 +114,11 @@ const LazyContractEditModulesPage = dynamic(() =>
114
114
( { ContractEditModulesPage } ) => ContractEditModulesPage ,
115
115
) ,
116
116
) ;
117
+ const LazyContractEmbedPage = dynamic ( ( ) =>
118
+ import ( "../tabs/embed/page" ) . then (
119
+ ( { ContractEmbedPage } ) => ContractEmbedPage ,
120
+ ) ,
121
+ ) ;
117
122
118
123
export function useContractRouteConfig (
119
124
contractAddress : string ,
@@ -225,6 +230,32 @@ export function useContractRouteConfig(
225
230
} ;
226
231
} , [ contractQuery ] ) ;
227
232
233
+ const embedType : "marketplace-v3" | "erc20" | "erc1155" | "erc721" | null =
234
+ useMemo ( ( ) => {
235
+ if (
236
+ contractData . detectedEnglishAuctions ||
237
+ contractData . detectedDirectListings
238
+ ) {
239
+ // this means its marketplace v3
240
+ return "marketplace-v3" ;
241
+ }
242
+ // others only matter if claim conditions are detected
243
+ if ( contractData . hasNewClaimConditions ) {
244
+ // if erc721 its that
245
+ if ( isERC721Query . data ) {
246
+ return "erc721" ;
247
+ }
248
+ // if erc1155 its that
249
+ if ( isERC1155Query . data ) {
250
+ return "erc1155" ;
251
+ }
252
+ // otherwise it has to be erc20
253
+ return "erc20" ;
254
+ }
255
+ // otherwise null
256
+ return null ;
257
+ } , [ contractData , isERC721Query . data , isERC1155Query . data ] ) ;
258
+
228
259
return [
229
260
{
230
261
title : "Overview" ,
@@ -282,6 +313,29 @@ export function useContractRouteConfig(
282
313
) ,
283
314
isDefault : true ,
284
315
} ,
316
+ {
317
+ title : "Embed" ,
318
+ path : "embed" ,
319
+ isDefault : true ,
320
+ isEnabled :
321
+ embedType !== null
322
+ ? "enabled"
323
+ : isERC721Query . isLoading || isERC1155Query . isLoading
324
+ ? "loading"
325
+ : "disabled" ,
326
+ component : ( ) => {
327
+ return (
328
+ < >
329
+ { contract && (
330
+ < LazyContractEmbedPage
331
+ contract = { contract }
332
+ ercOrMarketplace = { embedType }
333
+ />
334
+ ) }
335
+ </ >
336
+ ) ;
337
+ } ,
338
+ } ,
285
339
{
286
340
title : "Analytics" ,
287
341
path : "analytics" ,
0 commit comments