Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into multiple-connection…
Browse files Browse the repository at this point in the history
…-support
  • Loading branch information
tolgahan-arikan committed Jan 16, 2025
2 parents dc75502 + 629db5d commit ed2ce6d
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 7 deletions.
9 changes: 9 additions & 0 deletions packages/checkout/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @0xsequence/kit-connectors

## 4.5.7

### Patch Changes

- QR code improvement for NFT checkout

- Updated dependencies []:
- @0xsequence/kit@4.5.7

## 4.5.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/checkout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit-checkout",
"version": "4.5.6",
"version": "4.5.7",
"description": "Checkout UI for Sequence Kit",
"repository": "https://github.com/0xsequence/kit/tree/master/packages/checkout",
"author": "Horizon Blockchain Games",
Expand Down
42 changes: 38 additions & 4 deletions packages/checkout/src/views/PaymentSelection/TransferFunds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import { useState, useEffect } from 'react'
import { Box, Card, CheckmarkIcon, CopyIcon, IconButton, Text, truncateAddress } from '@0xsequence/design-system'
import { CopyToClipboard } from 'react-copy-to-clipboard'

import { useSelectPaymentModal, useTransferFundsModal } from '../../hooks'
import { QRCodeCanvas } from 'qrcode.react'
import { useAccount } from 'wagmi'

import { truncateAtMiddle } from '../../utils'

export const TransferFunds = () => {
const { openTransferFundsModal } = useTransferFundsModal()
const { openSelectPaymentModal, closeSelectPaymentModal, selectPaymentSettings } = useSelectPaymentModal()
const { address: userAddress } = useAccount()
const [isCopied, setCopy] = useState(false)

Expand All @@ -23,6 +24,27 @@ export const TransferFunds = () => {
setCopy(true)
}

const onClickQrCode = (e: React.MouseEvent<HTMLDivElement>) => {
e.preventDefault()
e.stopPropagation()
if (!selectPaymentSettings) {
return
}

closeSelectPaymentModal()

setTimeout(() => {
openTransferFundsModal({
walletAddress: userAddress || '',
onClose: () => {
setTimeout(() => {
openSelectPaymentModal(selectPaymentSettings)
}, 500)
}
})
}, 500)
}

return (
<Box width="full">
<Box marginBottom="3">
Expand All @@ -31,7 +53,14 @@ export const TransferFunds = () => {
</Text>
</Box>

<Card width="full" justifyContent="space-between" padding="4">
<Card
opacity={{ hover: '80' }}
onClick={onClickQrCode}
cursor="pointer"
width="full"
justifyContent="space-between"
padding="4"
>
<Box flexDirection="row" gap="3">
<Box background="white" padding="4" borderRadius="xs" style={{ width: 40, height: 40 }}>
<QRCodeCanvas
Expand All @@ -56,7 +85,12 @@ export const TransferFunds = () => {
</Box>
</Box>
</Box>
<Box>
<Box
onClick={e => {
e.stopPropagation()
e.preventDefault()
}}
>
<CopyToClipboard text={userAddress || ''} onCopy={handleCopy}>
<IconButton
color="text50"
Expand Down
6 changes: 6 additions & 0 deletions packages/kit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @0xsequence/kit

## 4.5.7

### Patch Changes

- QR code improvement for NFT checkout

## 4.5.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit",
"version": "4.5.6",
"version": "4.5.7",
"description": "Core package for Sequence Kit",
"keywords": [
"sequence",
Expand Down
9 changes: 9 additions & 0 deletions packages/wallet/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @0xsequence/kit-wallet

## 4.5.7

### Patch Changes

- QR code improvement for NFT checkout

- Updated dependencies []:
- @0xsequence/kit@4.5.7

## 4.5.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@0xsequence/kit-wallet",
"version": "4.5.6",
"version": "4.5.7",
"description": "Wallet UI for Sequence Kit",
"repository": "https://github.com/0xsequence/kit/tree/master/packages/wallet",
"author": "Horizon Blockchain Games",
Expand Down

0 comments on commit ed2ce6d

Please sign in to comment.