Skip to content

Commit

Permalink
Merge pull request #423 from reservoirprotocol/ted/upgrade-rk-1.21.0
Browse files Browse the repository at this point in the history
Upgrade rk to 1.21.0 and add new MintModal
  • Loading branch information
ted-palmer authored Dec 6, 2023
2 parents ca83a87 + 09e1e9e commit b3fa647
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
23 changes: 7 additions & 16 deletions components/buttons/Mint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, {
useContext,
} from 'react'
import { useConnectModal } from '@rainbow-me/rainbowkit'
import { CollectModal, CollectStep } from '@reservoir0x/reservoir-kit-ui'
import { MintStep, MintModal } from '@reservoir0x/reservoir-kit-ui'
import { useMarketplaceChain } from 'hooks'
import { CSS } from '@stitches/react'
import { Button } from 'components/primitives'
Expand All @@ -20,7 +20,7 @@ type Props = {
buttonProps?: ComponentProps<typeof Button>
buttonChildren?: ReactNode
mutate?: SWRResponse['mutate']
openState?: ComponentPropsWithoutRef<typeof CollectModal>['openState']
openState?: ComponentPropsWithoutRef<typeof MintModal>['openState']
}

const Mint: FC<Props> = ({
Expand All @@ -35,35 +35,26 @@ const Mint: FC<Props> = ({
const { openConnectModal } = useConnectModal()
const marketplaceChain = useMarketplaceChain()
const { feesOnTop } = useContext(ReferralContext)
const contract = collectionId?.split(':')?.[0]
const token = tokenId ? `${contract}:${tokenId}` : undefined

return (
<CollectModal
<MintModal
trigger={
<Button css={buttonCss} color="primary" {...buttonProps}>
{buttonChildren}
</Button>
}
collectionId={collectionId}
tokenId={tokenId}
mode={'mint'}
token={token}
openState={openState}
feesOnTopUsd={feesOnTop}
chainId={marketplaceChain.id}
onConnectWallet={() => {
openConnectModal?.()
}}
onClose={(data, currentStep) => {
if (mutate && currentStep == CollectStep.Complete) mutate()
}}
onPointerDownOutside={(e) => {
const privyLayer = document.getElementById('privy-dialog')

const clickedInsidePrivyLayer =
privyLayer && e.target ? privyLayer.contains(e.target as Node) : false

if (clickedInsidePrivyLayer) {
e.preventDefault()
}
if (mutate && currentStep == MintStep.Complete) mutate()
}}
/>
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@radix-ui/react-toggle-group": "^1.0.1",
"@radix-ui/react-tooltip": "1.0.6",
"@rainbow-me/rainbowkit": "^1.1.3",
"@reservoir0x/reservoir-kit-ui": "1.20.0",
"@reservoir0x/reservoir-kit-ui": "1.21.0",
"@sentry/nextjs": "^7.53.1",
"@types/uuid": "^9.0.1",
"dayjs": "^1.11.6",
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1435,10 +1435,10 @@
dependencies:
"@react-hookz/deep-equal" "^1.0.3"

"@reservoir0x/reservoir-kit-ui@1.20.0":
version "1.20.0"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-kit-ui/-/reservoir-kit-ui-1.20.0.tgz#4650597d9334ab7a3b9c53e83ef5ae20d29e9f63"
integrity sha512-ieV/f2b4eMOp2FYdIBLF2vqOUEGmN3dlQGflqq8MrtjKk3GBy6BPi6upvGivnO8bsVjzKH/36ueIcQNkXAG9sA==
"@reservoir0x/reservoir-kit-ui@1.21.0":
version "1.21.0"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-kit-ui/-/reservoir-kit-ui-1.21.0.tgz#e36aadf4414a53081fe04e5199eec2113b3377b3"
integrity sha512-0OViceR3s9vl/ZaCZevyuxlIpXh3DfRR9e4r35QHlzkqok7uyxEX3mc5D/iVXVBMnvGzzY+PNNHyJflgpofmEw==
dependencies:
"@fortawesome/fontawesome-svg-core" "^6.1.1"
"@fortawesome/free-solid-svg-icons" "^6.1.1"
Expand All @@ -1454,18 +1454,18 @@
"@radix-ui/react-toggle-group" "1.0.4"
"@radix-ui/react-tooltip" "1.0.6"
"@react-hookz/web" "^19.2.0"
"@reservoir0x/reservoir-sdk" "1.9.2"
"@reservoir0x/reservoir-sdk" "1.10.0"
"@stitches/react" "1.3.1-1"
dayjs "^1.11.4"
flatpickr "^4.6.13"
framer-motion "^6.4.2"
react-flatpickr "^3.10.13"
swr "2.0.1"

"@reservoir0x/reservoir-sdk@1.9.2":
version "1.9.2"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-sdk/-/reservoir-sdk-1.9.2.tgz#02f19d9fa19ca8f6bd60bc4fbaf3d699cbb06bf0"
integrity sha512-5OHQmkJX9mxR2idQypnLgfV44FojyVZ3REQ9Yue46oT24xr51Q4HdlnmqTuaBaVLeCycXK2Vn7CnNOOASf+Nyg==
"@reservoir0x/reservoir-sdk@1.10.0":
version "1.10.0"
resolved "https://registry.yarnpkg.com/@reservoir0x/reservoir-sdk/-/reservoir-sdk-1.10.0.tgz#972c1f427d0ab0e070f1e5c6484a2ed9f257ef4c"
integrity sha512-VeSx6nDUfCnyEpQL0sOo+U4qAa2pvFUk0vBQdPc2P57RGBs4Ze+xIqP3oj0OcaRavaMeoFrIHK522/nEoSLsBw==
dependencies:
axios "^0.27.2"

Expand Down

1 comment on commit b3fa647

@vercel
Copy link

@vercel vercel bot commented on b3fa647 Dec 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.