11'use client'
22import { Button } from '@/components/0_Bruddle/Button'
33import Card from '@/components/Global/Card'
4+ import CopyToClipboard from '@/components/Global/CopyToClipboard'
45import NavHeader from '@/components/Global/NavHeader'
56import QRCodeWrapper from '@/components/Global/QRCodeWrapper'
67import AvatarWithBadge from '@/components/Profile/AvatarWithBadge'
7- import { copyTextToClipboardWithFallback } from '@/utils'
88import Image , { StaticImageData } from 'next/image'
9- import { useCallback , useState } from 'react '
9+ import { useRouter } from 'next/navigation '
1010
1111interface CryptoDepositQRProps {
1212 tokenName : string
@@ -25,14 +25,7 @@ export const CryptoDepositQR = ({
2525 tokenIcon,
2626 chainIcon,
2727} : CryptoDepositQRProps ) => {
28- const [ copied , setCopied ] = useState ( false )
29-
30- const handleCopyAddress = useCallback ( ( ) => {
31- copyTextToClipboardWithFallback ( depositAddress )
32- setCopied ( true )
33- const timer = setTimeout ( ( ) => setCopied ( false ) , 2000 )
34- return ( ) => clearTimeout ( timer )
35- } , [ depositAddress ] )
28+ const router = useRouter ( )
3629
3730 return (
3831 < div className = "flex w-full flex-col justify-start space-y-8 pb-5 md:pb-0" >
@@ -64,15 +57,18 @@ export const CryptoDepositQR = ({
6457 < label htmlFor = "deposit-address" className = "text-sm font-bold text-black" >
6558 Your deposit address
6659 </ label >
67- < Card className = "px-4 py-3 text-xs text-grey-1" > { depositAddress } </ Card >
60+ < Card className = "flex items-center justify-between px-4 py-3 text-xs text-grey-1" >
61+ < p className = "text-xs md:text-sm md:font-semibold" > { depositAddress } </ p >
62+
63+ < CopyToClipboard textToCopy = { depositAddress } className = "text-black" iconSize = { '4' } />
64+ </ Card >
6865 < Button
6966 variant = "purple"
70- onClick = { handleCopyAddress }
71- className = "w-full"
72- icon = { copied ? 'check' : 'copy' }
67+ onClick = { ( ) => router . push ( '/home' ) }
68+ className = "mt-4 w-full"
7369 shadowSize = "4"
7470 >
75- { copied ? 'Copied!' : 'Copy' }
71+ I did it!
7672 </ Button >
7773 </ div >
7874 </ div >
0 commit comments