Skip to content

Commit

Permalink
fixed add funds modal, trigger modal
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA committed Sep 9, 2024
1 parent 7473a71 commit cfcc337
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
13 changes: 12 additions & 1 deletion packages/checkout/src/views/AddFunds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react'

import { useAddFundsModal } from '../hooks'
import { getTransakLink } from '../utils/transak'
import { HEADER_HEIGHT } from '../constants'

export const AddFundsContent = () => {
const { addFundsSettings } = useAddFundsModal()
Expand All @@ -14,7 +15,17 @@ export const AddFundsContent = () => {
const link = getTransakLink(addFundsSettings)

return (
<Box alignItems="center" width="full" paddingX="4" paddingBottom="4" height="full" style={{ height: '600px' }}>
<Box
alignItems="center"
width="full"
paddingX="4"
paddingBottom="4"
height="full"
style={{
height: '600px',
paddingTop: HEADER_HEIGHT
}}
>
<Box as="iframe" width="full" height="full" borderWidth="none" src={link} />
</Box>
)
Expand Down
13 changes: 12 additions & 1 deletion packages/checkout/src/views/PaymentSelection/FiatOnRamp.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Box, Button, Card, Text, useMediaQuery } from '@0xsequence/design-system'
import { getCardHeight } from '../../utils/sizing'
import { useAddFundsModal, useSelectPaymentModal } from '../../hooks'
import { useAccount } from 'wagmi'

interface FiatOnRampProps {
disableButtons: boolean
Expand All @@ -9,7 +11,16 @@ export const FiatOnRamp = ({
disableButtons
}: FiatOnRampProps) => {
const isMobile = useMediaQuery('isMobile')
const onClickPurchase = () => {}
const { closeSelectPaymentModal } = useSelectPaymentModal()
const { triggerAddFunds } = useAddFundsModal()
const { address: userAddress } = useAccount()

const onClickPurchase = () => {
closeSelectPaymentModal()
triggerAddFunds({
walletAddress: userAddress || ''
})
}

return (
<Card
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Box,Button, Card, Text, useMediaQuery } from '@0xsequence/design-system
import { useAccount } from 'wagmi'

import { getCardHeight } from '../../utils/sizing'
import { useTransferFundsModal } from '../../hooks'
import { useTransferFundsModal, useSelectPaymentModal } from '../../hooks'

interface TransferFundsProps {
disableButtons: boolean
Expand All @@ -14,11 +14,13 @@ export const TransferFunds = ({
const isMobile = useMediaQuery('isMobile')
const { openTransferFundsModal } = useTransferFundsModal()
const { address: userAddress } = useAccount()
const { closeSelectPaymentModal } = useSelectPaymentModal()

const onClickTransfer = () => {
if (!userAddress) {
return
}
closeSelectPaymentModal()
openTransferFundsModal({
walletAddress: userAddress
})
Expand Down

0 comments on commit cfcc337

Please sign in to comment.