Skip to content

Commit f7acb72

Browse files
committed
Dashboard: Fix No Funds PayEmbed in TransactionButton
1 parent 857d4df commit f7acb72

File tree

2 files changed

+25
-30
lines changed

2 files changed

+25
-30
lines changed

apps/dashboard/src/@/components/tx-button/MismatchButton.tsx

Lines changed: 24 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
} from "thirdweb";
1919
import { type Chain, type ChainMetadata, localhost } from "thirdweb/chains";
2020
import {
21-
PayEmbed,
21+
CheckoutWidget,
2222
useActiveAccount,
2323
useActiveWallet,
2424
useActiveWalletChain,
@@ -29,7 +29,6 @@ import {
2929
import { privateKeyToAccount, type Wallet } from "thirdweb/wallets";
3030
import { apiServerProxy } from "@/actions/proxies";
3131
import { Button } from "@/components/ui/button";
32-
import { DynamicHeight } from "@/components/ui/DynamicHeight";
3332
import {
3433
Dialog,
3534
DialogContent,
@@ -253,37 +252,33 @@ export const MismatchButton = forwardRef<
253252
className={cn(
254253
"gap-0 p-0",
255254
dialog === "no-funds" && "md:!max-w-[480px]",
256-
dialog === "pay" && "md:!max-w-[360px] border-none bg-transparent",
255+
dialog === "pay" && "md:!max-w-[480px] border-none bg-transparent",
257256
)}
258257
dialogCloseClassName="focus:ring-0"
259258
>
260-
<DynamicHeight>
261-
{dialog === "no-funds" && (
262-
<NoFundsDialogContent
263-
chain={txChain}
264-
client={props.client}
265-
isLoggedIn={props.isLoggedIn}
266-
onCloseModal={() => setDialog(undefined)}
267-
openPayModal={() => {
268-
setDialog("pay");
269-
}}
270-
/>
271-
)}
259+
{dialog === "no-funds" && (
260+
<NoFundsDialogContent
261+
chain={txChain}
262+
client={props.client}
263+
isLoggedIn={props.isLoggedIn}
264+
onCloseModal={() => setDialog(undefined)}
265+
openPayModal={() => {
266+
setDialog("pay");
267+
}}
268+
/>
269+
)}
272270

273-
{dialog === "pay" && (
274-
<PayEmbed
275-
className="!w-auto"
276-
client={props.client}
277-
payOptions={{
278-
prefillBuy: {
279-
amount: "0.01",
280-
chain: txChain,
281-
},
282-
}}
283-
theme={getSDKTheme(theme === "dark" ? "dark" : "light")}
284-
/>
285-
)}
286-
</DynamicHeight>
271+
{dialog === "pay" && account && (
272+
<CheckoutWidget
273+
className="!w-full"
274+
client={props.client}
275+
chain={txChain}
276+
amount="0.01"
277+
name="Buy Funds"
278+
seller={account.address as `0x${string}`}
279+
theme={getSDKTheme(theme === "dark" ? "dark" : "light")}
280+
/>
281+
)}
287282
</DialogContent>
288283
</Dialog>
289284
</>

apps/dashboard/src/@/components/ui/DynamicHeight.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function DynamicHeight(props: {
1717
boxSizing: "border-box",
1818
height: height ? `${height}px` : "auto",
1919
overflow: "hidden",
20-
transition: props.transition || "height 250ms ease",
20+
transition: props.transition || "height 220ms ease",
2121
}}
2222
>
2323
<div

0 commit comments

Comments
 (0)