fix select bridge

This commit is contained in:
2026-07-02 20:22:48 +03:00
parent 68e9df3246
commit 1f8b9c3674
8 changed files with 37 additions and 26 deletions

View File

@@ -152,7 +152,7 @@ export function BridgeForm() {
}
: null
const { data: relayQuote } = useRelayQuote(relayQuotePayload)
const { data: relayQuote, isFetching: isRelayQuoteFetching } = useRelayQuote(relayQuotePayload)
const serviceFee = relayQuote?.appCommission?.usd?.toString()
const serviceFeeToken = relayQuote?.appCommission?.inToken
@@ -249,6 +249,7 @@ export function BridgeForm() {
amount={displayToAmount}
onTokenChange={setToToken}
hideNetworkSelect
loading={isRelayQuoteFetching}
/>
<BridgeInfoPanel serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />

View File

@@ -146,6 +146,12 @@
font-weight: 700;
white-space: nowrap;
line-height: 1;
opacity: 1;
transition: opacity 0.15s ease;
}
.displayLoading {
opacity: 0.4;
}
.int {

View File

@@ -15,6 +15,7 @@ interface Props {
selectedNetwork?: string
onNetworkChange?: (network: string) => void
hideNetworkSelect?: boolean
loading?: boolean
}
const NETWORKS = ['ETH', 'BSC', 'TRX', 'SOL']
@@ -23,7 +24,7 @@ const PERCENTS = [25, 50, 100]
export function SwapCard({
mode, token, tokenOptions, amount, usd,
onTokenChange, onAmountChange, onSetPercent,
selectedNetwork, onNetworkChange, hideNetworkSelect,
selectedNetwork, onNetworkChange, hideNetworkSelect, loading,
}: Props) {
const [intPart, decPart] = truncateDecimals(amount, 8).split('.')
@@ -86,7 +87,7 @@ export function SwapCard({
placeholder="0"
/>
) : (
<div className={styles.display}>
<div className={`${styles.display} ${loading ? styles.displayLoading : ''}`}>
<span className={styles.int}>{intPart}</span>
{decPart && <span className={styles.dec}>.{decPart}</span>}
</div>

View File

@@ -85,7 +85,7 @@ export function SwapForm() {
}
: null
const { data: quoteData } = useRelayQuote(quotePayload)
const { data: quoteData, isFetching: isQuoteFetching } = useRelayQuote(quotePayload)
const { mutate: executeSwap, isPending: isSwapping } = useExecuteRelaySwap()
const { mutate: signSwap, isPending: isSigning } = useSignSwap()
@@ -94,7 +94,7 @@ export function SwapForm() {
? { from: fromToken.symbol, to: toToken.symbol, amountHuman: debouncedAmount }
: null
const { data: trxQuoteData } = useTrxSwapQuote(trxQuotePayload)
const { data: trxQuoteData, isFetching: isTrxQuoteFetching } = useTrxSwapQuote(trxQuotePayload)
const { mutate: fetchTrxQuote, isPending: isFetchingTrxQuote } = useFetchTrxQuote()
const { mutate: executeTrxSwap, isPending: isExecutingTrxSwap } = useExecuteTrxSwap()
@@ -111,6 +111,8 @@ export function SwapForm() {
? undefined
: quoteData?.details.currencyOut.amountUsd
const isToAmountLoading = isTrxNetwork ? isTrxQuoteFetching : isQuoteFetching
const gasFee = isTrxNetwork
? trxQuoteData?.fees.network.amountUsd?.toString()
: quoteData?.fees.gas.amountUsd
@@ -160,6 +162,7 @@ export function SwapForm() {
amount={displayToAmount}
usd={displayToUsd}
onTokenChange={setToToken}
loading={isToAmountLoading}
/>
<SwapInfoPanel gasFee={gasFee} serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />