diff --git a/components/dialogs/transfer/bridge-prompt-usdc.tsx b/components/dialogs/transfer/bridge-prompt-usdc.tsx new file mode 100644 index 00000000..6e9e5f83 --- /dev/null +++ b/components/dialogs/transfer/bridge-prompt-usdc.tsx @@ -0,0 +1,19 @@ +import { Label } from "@/components/ui/label" + +import { cn } from "@/lib/utils" + +export function BridgePromptUSDC({ onClick }: { onClick: () => void }) { + return ( +
+
+ +
{`Powered by Across`}
+
+
+ ) +} diff --git a/components/dialogs/transfer/review-bridge.tsx b/components/dialogs/transfer/review-bridge.tsx index a75e0566..ac91e3f8 100644 --- a/components/dialogs/transfer/review-bridge.tsx +++ b/components/dialogs/transfer/review-bridge.tsx @@ -13,7 +13,6 @@ import { FetchStatus } from "@tanstack/react-query" import { formatUnits } from "viem/utils" import { getChainName } from "@/components/dialogs/transfer/helpers" -import { Button } from "@/components/ui/button" import { Separator } from "@/components/ui/separator" import { cn } from "@/lib/utils" @@ -101,13 +100,13 @@ function ReviewBridgeContent({ quote }: { quote: LiFiStep }) { > - -
+ +
{`Review bridge from ${getChainName(fromChainId)} to ${getChainName(toChainId)}`}
- {`Bridge ${fromAmountFormatted} ${fromSymbol} using ${toolName}`} +
{`Bridge ${fromAmountFormatted} ${fromSymbol} using ${toolName}`}
diff --git a/components/dialogs/transfer/usdc-form.tsx b/components/dialogs/transfer/usdc-form.tsx index 2c02c150..46d7465f 100644 --- a/components/dialogs/transfer/usdc-form.tsx +++ b/components/dialogs/transfer/usdc-form.tsx @@ -7,14 +7,14 @@ import { AlertCircle, Check, Loader2 } from "lucide-react" import { UseFormReturn, useWatch } from "react-hook-form" import { toast } from "sonner" import { useDebounceValue } from "usehooks-ts" -import { extractChain, formatUnits, isAddress, parseUnits } from "viem" +import { formatUnits, isAddress, parseUnits } from "viem" import { mainnet } from "viem/chains" import { useAccount, useSendTransaction, useSwitchChain } from "wagmi" import { z } from "zod" import { TokenSelect } from "@/components/dialogs/token-select" +import { BridgePromptUSDC } from "@/components/dialogs/transfer/bridge-prompt-usdc" import { - CHAIN_NAME_MAP, ExternalTransferDirection, checkAmount, checkBalance, @@ -992,11 +992,23 @@ export function USDCForm({ : "--"}
- {bridgeRequired && ( + {bridgeRequired ? ( + ) : ( + { + if (Number(formattedUsdcL1Balance)) { + setNetwork(mainnet.id) + form.setValue("amount", formattedUsdcL1Balance, { + shouldValidate: true, + shouldDirty: true, + }) + } + }} + /> )}