diff --git a/components/Head.tsx b/components/Head.tsx index 628d9a847..ccaa16098 100644 --- a/components/Head.tsx +++ b/components/Head.tsx @@ -1,5 +1,6 @@ import { FC } from 'react' import NextHead from 'next/head' +import { Token } from '@reservoir0x/reservoir-kit-ui' type Props = { ogImage?: string @@ -16,7 +17,7 @@ type Props = { */ export const Head: FC = ({ ogImage = 'https://explorer.reservoir.tools/og-image.png', - title = 'Reservoir | Multi-Chain NFT Explorer', + title = 'Reservoir | Multi-Chain NF`T Explorer', description = 'Reservoir Multi-Chain NFT Explorer is an open source NFT explorer built with Reservoir.', metatags = null, }) => { diff --git a/components/frames/index.tsx b/components/frames/index.tsx new file mode 100644 index 000000000..76de0bec0 --- /dev/null +++ b/components/frames/index.tsx @@ -0,0 +1,33 @@ +import { Token } from '@reservoir0x/reservoir-kit-ui' +import { useMarketplaceChain } from 'hooks' + +interface Props { + token: Token +} + +const Frame: React.FC = ({ token }) => { + const marketplaceChain = useMarketplaceChain() + + return ( + <> + {/* Warpcast NFT Old Spec */} + + + + + + + ) +} diff --git a/components/portfolio/ApprovalCollapsible.tsx b/components/portfolio/ApprovalCollapsible.tsx index 1c0bd3e1b..55a59f1f1 100644 --- a/components/portfolio/ApprovalCollapsible.tsx +++ b/components/portfolio/ApprovalCollapsible.tsx @@ -29,14 +29,12 @@ const Img = styled('img', { type Props = { item: NonNullable[0]['items']>[0] batchListingData: BatchListingData[] - selectedMarketplaces: Marketplace[] open?: boolean } export const ApprovalCollapsible: FC = ({ item, batchListingData, - selectedMarketplaces, open, }) => { const [collapsibleOpen, setCollapsibleOpen] = useState(false) @@ -45,37 +43,6 @@ export const ApprovalCollapsible: FC = ({ const orderIndexes = item?.orderIndexes || [] - const marketplacesSeekingApproval = useMemo(() => { - let uniqueMarketplaces: Marketplace[] = [] - - orderIndexes.forEach((orderIndex) => { - if (batchListingData[orderIndex]) { - const listing = batchListingData[orderIndex].listing - - const marketplace = selectedMarketplaces.find( - (m) => m.orderbook === listing.orderbook - ) - - if ( - marketplace && - !uniqueMarketplaces.find( - (uniqueMarketplace) => - uniqueMarketplace.orderbook === marketplace.orderbook - ) - ) { - uniqueMarketplaces.push(marketplace) - } - } - }) - return uniqueMarketplaces - }, [orderIndexes, item, batchListingData]) - - const marketplaceNames = useMemo(() => { - return marketplacesSeekingApproval - .map((marketplace) => marketplace.name) - .join(' and ') - }, [marketplacesSeekingApproval]) - const collectionImage: string = useMemo(() => { const token = batchListingData[orderIndexes[0]]?.token?.token return ( @@ -166,12 +133,9 @@ export const ApprovalCollapsible: FC = ({ - {marketplacesSeekingApproval.map((marketplace) => ( - - ))} - Approve {collectionName} on {marketplaceNames} + Approve {collectionName} diff --git a/components/portfolio/BatchListModal.tsx b/components/portfolio/BatchListModal.tsx index 99696abb2..706ab7c9c 100644 --- a/components/portfolio/BatchListModal.tsx +++ b/components/portfolio/BatchListModal.tsx @@ -44,21 +44,13 @@ type BatchListModalStepData = { type Props = { listings: BatchListing[] disabled: boolean - selectedMarketplaces: Marketplace[] - onChainRoyalties: ReturnType['data'] onCloseComplete?: () => void } const orderFee = process.env.NEXT_PUBLIC_MARKETPLACE_FEE const orderFees = orderFee ? [orderFee] : [] -const BatchListModal: FC = ({ - listings, - disabled, - selectedMarketplaces, - onChainRoyalties, - onCloseComplete, -}) => { +const BatchListModal: FC = ({ listings, disabled, onCloseComplete }) => { const [open, setOpen] = useState(false) const { data: wallet } = useWalletClient() const { openConnectModal } = useConnectModal() @@ -81,30 +73,9 @@ const BatchListModal: FC = ({ [] ) - const getUniqueMarketplaces = useCallback( - (listings: BatchListModalStepData['listings']): Marketplace[] => { - const marketplaces: Marketplace[] = [] - listings.forEach((listing) => { - const marketplace = selectedMarketplaces.find( - (m) => m.orderbook === listing.listing.orderbook - ) - if (marketplace && !marketplaces.includes(marketplace)) { - marketplaces.push(marketplace) - } - }) - return marketplaces - }, - [listings] - ) - useEffect(() => { if (stepData) { const orderKind = stepData.listings[0].listing.orderKind || 'exchange' - const marketplaces = getUniqueMarketplaces(stepData.listings) - const marketplaceNames = marketplaces - .map((marketplace) => marketplace.name) - .join(' and ') - setUniqueMarketplaces(marketplaces) switch (stepData.currentStep.kind) { case 'transaction': { @@ -116,9 +87,7 @@ const BatchListModal: FC = ({ break } case 'signature': { - setStepTitle( - `Confirm listings on ${marketplaceNames}\nin your wallet` - ) + setStepTitle(`Confirm listings in your wallet`) break } } @@ -178,29 +147,6 @@ const BatchListModal: FC = ({ convertedListing.expirationTime = expirationTime } - const onChainRoyalty = - onChainRoyalties && onChainRoyalties[i] ? onChainRoyalties[i] : null - if (onChainRoyalty && listing.orderKind?.includes('seaport')) { - convertedListing.automatedRoyalties = false - const royaltyData = onChainRoyalty.result as OnChainRoyaltyReturnType - const royalties = royaltyData[0].map((recipient, i) => { - const bps = Math.floor( - (parseFloat( - formatUnits( - royaltyData[1][i], - marketplaceChain?.nativeCurrency.decimals || 18 - ) - ) / - 1) * - 10000 - ) - return `${recipient}:${bps}` - }) - if (royalties.length > 0) { - convertedListing.fees = [...royalties] - } - } - batchListingData.push({ listing: convertedListing, token: listing.token, @@ -268,7 +214,7 @@ const BatchListModal: FC = ({ ) setTransactionError(transactionError) }) - }, [client, listings, wallet, onChainRoyalties]) + }, [client, listings, wallet]) const trigger = (