diff --git a/apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx b/apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx index d41b0d6479e..cc3a563e92a 100644 --- a/apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx +++ b/apps/dashboard/src/@/components/blocks/BuyAndSwapEmbed.tsx @@ -2,13 +2,8 @@ "use client"; import { useTheme } from "next-themes"; -import { useEffect, useMemo, useRef, useState } from "react"; -import { defineChain } from "thirdweb"; -import { - BuyWidget, - type SupportedFiatCurrency, - SwapWidget, -} from "thirdweb/react"; +import { useEffect, useMemo, useRef } from "react"; +import { BridgeWidget, type SupportedFiatCurrency } from "thirdweb/react"; import type { Wallet } from "thirdweb/wallets"; import { reportAssetBuyCancelled, @@ -22,14 +17,12 @@ import { reportTokenSwapFailed, reportTokenSwapSuccessful, } from "@/analytics/report"; -import { Button } from "@/components/ui/button"; import { NEXT_PUBLIC_ASSET_PAGE_CLIENT_ID, NEXT_PUBLIC_BRIDGE_IFRAME_CLIENT_ID, NEXT_PUBLIC_BRIDGE_PAGE_CLIENT_ID, NEXT_PUBLIC_CHAIN_PAGE_CLIENT_ID, } from "@/constants/public-envs"; -import { cn } from "@/lib/utils"; import { parseError } from "@/utils/errorParser"; import { getSDKTheme } from "@/utils/sdk-component-theme"; import { appMetadata } from "../../constants/connect"; @@ -71,11 +64,11 @@ export type BuyAndSwapEmbedProps = { pageType: PageType; wallets?: Wallet[]; currency?: SupportedFiatCurrency; + showThirdwebBranding?: boolean; }; export function BuyAndSwapEmbed(props: BuyAndSwapEmbedProps) { const { theme } = useTheme(); - const [tab, setTab] = useState<"buy" | "swap">("swap"); const themeObj = getSDKTheme(theme === "light" ? "light" : "dark"); const isMounted = useRef(false); @@ -108,211 +101,161 @@ export function BuyAndSwapEmbed(props: BuyAndSwapEmbedProps) { }, [props.pageType]); return ( -
+ Sets the default token and amount to{" "}
+ {props.type === "buyToken" ? "buy" : "sell"} in the widget,
+ User can change this default selection in the widget
+