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" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
<title>ЭКСА — Ваш мост в мир цифровых активов</title>
|
||||||
<script type="module" crossorigin src="/assets/index-CI1EaW5Q.js"></script>
|
<script type="module" crossorigin src="/assets/index-DQISApfg.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CLXpUMJi.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-CmBRAAIp.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ export function BridgeForm() {
|
|||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
|
|
||||||
const { data: relayQuote } = useRelayQuote(relayQuotePayload)
|
const { data: relayQuote, isFetching: isRelayQuoteFetching } = useRelayQuote(relayQuotePayload)
|
||||||
|
|
||||||
const serviceFee = relayQuote?.appCommission?.usd?.toString()
|
const serviceFee = relayQuote?.appCommission?.usd?.toString()
|
||||||
const serviceFeeToken = relayQuote?.appCommission?.inToken
|
const serviceFeeToken = relayQuote?.appCommission?.inToken
|
||||||
@@ -249,6 +249,7 @@ export function BridgeForm() {
|
|||||||
amount={displayToAmount}
|
amount={displayToAmount}
|
||||||
onTokenChange={setToToken}
|
onTokenChange={setToToken}
|
||||||
hideNetworkSelect
|
hideNetworkSelect
|
||||||
|
loading={isRelayQuoteFetching}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BridgeInfoPanel serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />
|
<BridgeInfoPanel serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />
|
||||||
|
|||||||
@@ -146,6 +146,12 @@
|
|||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
opacity: 1;
|
||||||
|
transition: opacity 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.displayLoading {
|
||||||
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
.int {
|
.int {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ interface Props {
|
|||||||
selectedNetwork?: string
|
selectedNetwork?: string
|
||||||
onNetworkChange?: (network: string) => void
|
onNetworkChange?: (network: string) => void
|
||||||
hideNetworkSelect?: boolean
|
hideNetworkSelect?: boolean
|
||||||
|
loading?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const NETWORKS = ['ETH', 'BSC', 'TRX', 'SOL']
|
const NETWORKS = ['ETH', 'BSC', 'TRX', 'SOL']
|
||||||
@@ -23,7 +24,7 @@ const PERCENTS = [25, 50, 100]
|
|||||||
export function SwapCard({
|
export function SwapCard({
|
||||||
mode, token, tokenOptions, amount, usd,
|
mode, token, tokenOptions, amount, usd,
|
||||||
onTokenChange, onAmountChange, onSetPercent,
|
onTokenChange, onAmountChange, onSetPercent,
|
||||||
selectedNetwork, onNetworkChange, hideNetworkSelect,
|
selectedNetwork, onNetworkChange, hideNetworkSelect, loading,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
const [intPart, decPart] = truncateDecimals(amount, 8).split('.')
|
const [intPart, decPart] = truncateDecimals(amount, 8).split('.')
|
||||||
|
|
||||||
@@ -86,7 +87,7 @@ export function SwapCard({
|
|||||||
placeholder="0"
|
placeholder="0"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className={styles.display}>
|
<div className={`${styles.display} ${loading ? styles.displayLoading : ''}`}>
|
||||||
<span className={styles.int}>{intPart}</span>
|
<span className={styles.int}>{intPart}</span>
|
||||||
{decPart && <span className={styles.dec}>.{decPart}</span>}
|
{decPart && <span className={styles.dec}>.{decPart}</span>}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export function SwapForm() {
|
|||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
|
|
||||||
const { data: quoteData } = useRelayQuote(quotePayload)
|
const { data: quoteData, isFetching: isQuoteFetching } = useRelayQuote(quotePayload)
|
||||||
const { mutate: executeSwap, isPending: isSwapping } = useExecuteRelaySwap()
|
const { mutate: executeSwap, isPending: isSwapping } = useExecuteRelaySwap()
|
||||||
const { mutate: signSwap, isPending: isSigning } = useSignSwap()
|
const { mutate: signSwap, isPending: isSigning } = useSignSwap()
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ export function SwapForm() {
|
|||||||
? { from: fromToken.symbol, to: toToken.symbol, amountHuman: debouncedAmount }
|
? { from: fromToken.symbol, to: toToken.symbol, amountHuman: debouncedAmount }
|
||||||
: null
|
: null
|
||||||
|
|
||||||
const { data: trxQuoteData } = useTrxSwapQuote(trxQuotePayload)
|
const { data: trxQuoteData, isFetching: isTrxQuoteFetching } = useTrxSwapQuote(trxQuotePayload)
|
||||||
const { mutate: fetchTrxQuote, isPending: isFetchingTrxQuote } = useFetchTrxQuote()
|
const { mutate: fetchTrxQuote, isPending: isFetchingTrxQuote } = useFetchTrxQuote()
|
||||||
const { mutate: executeTrxSwap, isPending: isExecutingTrxSwap } = useExecuteTrxSwap()
|
const { mutate: executeTrxSwap, isPending: isExecutingTrxSwap } = useExecuteTrxSwap()
|
||||||
|
|
||||||
@@ -111,6 +111,8 @@ export function SwapForm() {
|
|||||||
? undefined
|
? undefined
|
||||||
: quoteData?.details.currencyOut.amountUsd
|
: quoteData?.details.currencyOut.amountUsd
|
||||||
|
|
||||||
|
const isToAmountLoading = isTrxNetwork ? isTrxQuoteFetching : isQuoteFetching
|
||||||
|
|
||||||
const gasFee = isTrxNetwork
|
const gasFee = isTrxNetwork
|
||||||
? trxQuoteData?.fees.network.amountUsd?.toString()
|
? trxQuoteData?.fees.network.amountUsd?.toString()
|
||||||
: quoteData?.fees.gas.amountUsd
|
: quoteData?.fees.gas.amountUsd
|
||||||
@@ -160,6 +162,7 @@ export function SwapForm() {
|
|||||||
amount={displayToAmount}
|
amount={displayToAmount}
|
||||||
usd={displayToUsd}
|
usd={displayToUsd}
|
||||||
onTokenChange={setToToken}
|
onTokenChange={setToToken}
|
||||||
|
loading={isToAmountLoading}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SwapInfoPanel gasFee={gasFee} serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />
|
<SwapInfoPanel gasFee={gasFee} serviceFee={serviceFee} serviceFeeToken={serviceFeeToken} />
|
||||||
|
|||||||
Reference in New Issue
Block a user