Skip to content

Commit ffb7b64

Browse files
[Dashboard] use BuyWidget on /bridge (#7590)
Fixes TOOL-5023 <!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR updates the `UniversalBridgeEmbed` component to replace the `PayEmbed` with `BuyWidget` from the `thirdweb` library, modifying how payment options are handled and improving the integration with the `thirdweb` SDK. ### Detailed summary - Replaced `PayEmbed` component with `BuyWidget`. - Removed `payOptions` prop and its nested properties. - Added `amount`, `chain`, and `tokenAddress` props to `BuyWidget`. - Updated the theme handling to use `getSDKTheme`. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Updated the embedded widget in the dashboard to use a new buy widget, offering a simplified and more direct interface for purchasing tokens. * **Refactor** * Streamlined the widget’s input options for a more straightforward user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 77063e5 commit ffb7b64

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

apps/dashboard/src/app/bridge/components/client/UniversalBridgeEmbed.tsx

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"use client";
22

33
import { useTheme } from "next-themes";
4-
import { PayEmbed, type TokenInfo } from "thirdweb/react";
4+
import type { Address } from "thirdweb";
5+
import { BuyWidget, type TokenInfo } from "thirdweb/react";
56
import { useV5DashboardChain } from "@/hooks/chains/v5-adapter";
67
import { getSDKTheme } from "@/utils/sdk-component-theme";
78
import { bridgeAppThirdwebClient } from "../../constants";
@@ -19,19 +20,11 @@ export function UniversalBridgeEmbed({
1920
const chain = useV5DashboardChain(chainId || 1);
2021

2122
return (
22-
<PayEmbed
23+
<BuyWidget
2324
client={bridgeAppThirdwebClient}
24-
payOptions={{
25-
mode: "fund_wallet",
26-
prefillBuy:
27-
chainId && token
28-
? {
29-
amount,
30-
chain,
31-
token,
32-
}
33-
: undefined,
34-
}}
25+
amount={amount || "0"}
26+
chain={chain}
27+
tokenAddress={token?.address as Address | undefined}
3528
theme={getSDKTheme(theme === "light" ? "light" : "dark")}
3629
/>
3730
);

0 commit comments

Comments
 (0)