From 7dee5adc813156d60ea3d6b152100705c0cf95c7 Mon Sep 17 00:00:00 2001 From: Alec Chen <93971719+0xAlec@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:18:45 -0700 Subject: [PATCH] add `fundingUrl` --- src/wallet/components/WalletDropdownFundLink.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/components/WalletDropdownFundLink.tsx b/src/wallet/components/WalletDropdownFundLink.tsx index 14ed43a81d..04311f45b8 100644 --- a/src/wallet/components/WalletDropdownFundLink.tsx +++ b/src/wallet/components/WalletDropdownFundLink.tsx @@ -21,9 +21,10 @@ export function WalletDropdownFundLink({ return icon; } }, [icon]); - + const currentURL = window.location.href; const tabName = document.title; + const fundingUrl = `http://keys.coinbase.com/funding?dappName=${tabName}&dappUrl=${currentURL}&onchainkit=${version}`; const windowSizes: Record< 's' | 'm' | 'l', { @@ -38,12 +39,11 @@ export function WalletDropdownFundLink({ const handleClick = (e: React.MouseEvent) => { e.preventDefault(); - const url = `http://keys.coinbase.com/funding?dappName=${tabName}&dappUrl=${currentURL}&onchainkit=${version}`; const { width, height } = windowSizes[windowSize]; const left = (window.screen.width - width) / 2; const top = (window.screen.height - height) / 2; const windowFeatures = `width=${width},height=${height},resizable,scrollbars=yes,status=1,left=${left},top=${top}`; - window.open(url, 'Coinbase Fund Wallet', windowFeatures); + window.open(fundingUrl, 'Coinbase Fund Wallet', windowFeatures); }; const commonClassName = cn( @@ -65,7 +65,7 @@ export function WalletDropdownFundLink({ return (