From 98eefdf90b0d6afcfc1765c57862afaca59cfb87 Mon Sep 17 00:00:00 2001 From: MananTank Date: Thu, 14 Aug 2025 18:58:15 +0000 Subject: [PATCH] Dashboard: Fix No Funds PayEmbed in TransactionButton (#7856) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ## PR-Codex overview This PR focuses on updating the `MismatchButton` component by replacing the `PayEmbed` with `CheckoutWidget`, adjusting the transition duration in `DynamicHeight`, and streamlining the dialog content structure. ### Detailed summary - Changed transition duration in `DynamicHeight` from `250ms` to `220ms`. - Replaced `PayEmbed` with `CheckoutWidget` in the `MismatchButton` component. - Simplified the dialog content structure by removing the `DynamicHeight` wrapper. - Adjusted class names for consistency and clarity. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` ## Summary by CodeRabbit - New Features - “Not enough funds” flow now uses a new checkout widget and only appears when your account is connected. - Style - Payment dialog is wider and uses full available width for improved readability. - Spacing and layout refined for a cleaner experience. - Slightly faster height transition animations for snappier UI feedback. - Refactor - Simplified dialog content by removing an extra height wrapper. --- .../@/components/tx-button/MismatchButton.tsx | 62 ++++++++----------- .../src/@/components/ui/DynamicHeight.tsx | 2 +- 2 files changed, 27 insertions(+), 37 deletions(-) diff --git a/apps/dashboard/src/@/components/tx-button/MismatchButton.tsx b/apps/dashboard/src/@/components/tx-button/MismatchButton.tsx index 5882ff0e7f6..edb78f5e9fd 100644 --- a/apps/dashboard/src/@/components/tx-button/MismatchButton.tsx +++ b/apps/dashboard/src/@/components/tx-button/MismatchButton.tsx @@ -18,7 +18,7 @@ import { } from "thirdweb"; import { type Chain, type ChainMetadata, localhost } from "thirdweb/chains"; import { - PayEmbed, + CheckoutWidget, useActiveAccount, useActiveWallet, useActiveWalletChain, @@ -29,7 +29,6 @@ import { import { privateKeyToAccount, type Wallet } from "thirdweb/wallets"; import { apiServerProxy } from "@/actions/proxies"; import { Button } from "@/components/ui/button"; -import { DynamicHeight } from "@/components/ui/DynamicHeight"; import { Dialog, DialogContent, @@ -251,39 +250,34 @@ export const MismatchButton = forwardRef< > - - {dialog === "no-funds" && ( - setDialog(undefined)} - openPayModal={() => { - setDialog("pay"); - }} - /> - )} + {dialog === "no-funds" && ( + setDialog(undefined)} + openPayModal={() => { + setDialog("pay"); + }} + /> + )} - {dialog === "pay" && ( - - )} - + {dialog === "pay" && account && ( + + )} @@ -362,11 +356,7 @@ function NoFundsDialogContent(props: { (x) => x.enabled && x.service === "pay", ) ? ( // pay case - ) : // no funds options available diff --git a/apps/dashboard/src/@/components/ui/DynamicHeight.tsx b/apps/dashboard/src/@/components/ui/DynamicHeight.tsx index 4835281db51..535be848aaa 100644 --- a/apps/dashboard/src/@/components/ui/DynamicHeight.tsx +++ b/apps/dashboard/src/@/components/ui/DynamicHeight.tsx @@ -17,7 +17,7 @@ export function DynamicHeight(props: { boxSizing: "border-box", height: height ? `${height}px` : "auto", overflow: "hidden", - transition: props.transition || "height 250ms ease", + transition: props.transition || "height 220ms ease", }} >