Skip to content

Commit

Permalink
Remove extra props chainId from SaleDirectButton
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasMahe committed Feb 3, 2024
1 parent c48e592 commit 947bb40
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 0 additions & 2 deletions components/Sales/Detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export type Props = {
tokenId: string
quantity: string
collection: {
chainId: number
standard: Standard
}
owned: {
Expand Down Expand Up @@ -83,7 +82,6 @@ const SaleDetail: FC<Props> = ({
<SaleDirectSummary sales={directSales} isSingle={isSingle} />
<SaleDirectButton
asset={asset}
chainId={asset.collection.chainId}
sales={directSales}
isHomepage={isHomepage}
ownAllSupply={ownAllSupply}
Expand Down
12 changes: 5 additions & 7 deletions components/Sales/Direct/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export type Props = {
collectionAddress: string
tokenId: string
}
chainId: number
isHomepage: boolean
sales: ModalProps['sales']
ownAllSupply: boolean
Expand All @@ -29,7 +28,6 @@ export type Props = {

const SaleDirectButton: FC<Props> = ({
asset,
chainId,
isHomepage,
sales,
ownAllSupply,
Expand All @@ -40,7 +38,7 @@ const SaleDirectButton: FC<Props> = ({
const [cancelOffer, { activeStep, transactionHash }] = useCancelOffer(signer)
const toast = useToast()
const { address } = useAccount()
const blockExplorer = useBlockExplorer(chainId)
const blockExplorer = useBlockExplorer(asset.chainId)
const { isOpen, onOpen, onClose } = useDisclosure()

const handleCancel = useCallback(
Expand Down Expand Up @@ -73,7 +71,7 @@ const SaleDirectButton: FC<Props> = ({
return (
<>
<ConnectButtonWithNetworkSwitch
chainId={chainId}
chainId={asset.chainId}
onClick={() => handleCancel(sale.id)}
isLoading={activeStep !== CancelOfferStep.INITIAL}
width="full"
Expand All @@ -98,8 +96,8 @@ const SaleDirectButton: FC<Props> = ({
}, [
activeStep,
address,
asset.chainId,
blockExplorer,
chainId,
handleCancel,
isOpen,
onClose,
Expand Down Expand Up @@ -145,12 +143,12 @@ const SaleDirectButton: FC<Props> = ({
if (sales.length <= 1) return
return (
<SaleDirectModal
chainId={chainId}
chainId={asset.chainId}
sales={sales}
onOfferCanceled={onOfferCanceled}
/>
)
}, [chainId, sales, onOfferCanceled])
}, [asset.chainId, sales, onOfferCanceled])

if (ownAllSupply && isHomepage)
return (
Expand Down

0 comments on commit 947bb40

Please sign in to comment.