fix select bridge
This commit is contained in:
1
dist/assets/index-CLXpUMJi.css
vendored
1
dist/assets/index-CLXpUMJi.css
vendored
File diff suppressed because one or more lines are too long
1
dist/assets/index-CmBRAAIp.css
vendored
Normal file
1
dist/assets/index-CmBRAAIp.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
dist/index.html
vendored
4
dist/index.html
vendored
@@ -5,8 +5,8 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
||||
<script type="module" crossorigin src="/assets/index-CI1EaW5Q.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CLXpUMJi.css">
|
||||
<script type="module" crossorigin src="/assets/index-DQISApfg.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-CmBRAAIp.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -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} />
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user