Skip to content

Commit b995b39

Browse files
committed
UI improvements to wallet dropdown and stuff
1 parent 40a3c5d commit b995b39

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

packages/nextjs/components/punk-society/PunkConnectButton/AddressInfoDropdown.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useRef, useState } from "react";
22
import Link from "next/link";
33
import { NetworkOptions } from "./NetworkOptions";
4-
import { FundButton } from "@coinbase/onchainkit/fund";
4+
import { FundButton, getOnrampBuyUrl } from "@coinbase/onchainkit/fund";
55
import { Avatar, Badge, Identity, Name } from "@coinbase/onchainkit/identity";
66
import CopyToClipboard from "react-copy-to-clipboard";
77
import { getAddress } from "viem";
@@ -37,7 +37,18 @@ export const AddressInfoDropdown = ({ address, blockExplorerAddressLink }: Addre
3737
const [addressCopied, setAddressCopied] = useState(false);
3838

3939
const [selectingNetwork, setSelectingNetwork] = useState(false);
40+
4041
const dropdownRef = useRef<HTMLDetailsElement>(null);
42+
43+
const projectId = process.env.NEXT_PUBLIC_CDP_PROJECT_ID || "";
44+
45+
const onrampBuyUrl = getOnrampBuyUrl({
46+
projectId,
47+
addresses: { connectedAddress: ["base"] },
48+
assets: ["USDC", "ETH"],
49+
presetFiatAmount: 20,
50+
fiatCurrency: "USD",
51+
});
4152
const closeDropdown = () => {
4253
setSelectingNetwork(false);
4354
dropdownRef.current?.removeAttribute("open");
@@ -84,7 +95,11 @@ export const AddressInfoDropdown = ({ address, blockExplorerAddressLink }: Addre
8495
</Link>
8596
</div>
8697
</li>
87-
<FundButton text="Add funds" className="py-1 px-3.5 gap-1 text-md rounded-xl justify-start font-normal" />
98+
<FundButton
99+
text="Add funds"
100+
fundingUrl={onrampBuyUrl}
101+
className="py-1 px-3.5 gap-1 text-md rounded-xl justify-start font-normal"
102+
/>
88103
<li className={selectingNetwork ? "hidden" : ""}>
89104
<button
90105
className="menu-item btn-sm !rounded-xl bg-[#4f46e5] hover:bg-[#4338CA] active:bg-[#4338CA] flex gap-3 py-3"

0 commit comments

Comments
 (0)