diff --git a/src/ui/views/Bridge/Component/BridgeContent.tsx b/src/ui/views/Bridge/Component/BridgeContent.tsx index 3aa4ee87da8..2769f44148e 100644 --- a/src/ui/views/Bridge/Component/BridgeContent.tsx +++ b/src/ui/views/Bridge/Component/BridgeContent.tsx @@ -144,7 +144,7 @@ export const BridgeContent = () => { setFetchingBridgeQuote(true); const { tx } = await pRetry( () => - wallet.openapi.getBridgeQuote({ + wallet.openapi.getBridgeQuoteTxV2({ aggregator_id: selectedBridgeQuote.aggregator.id, bridge_id: selectedBridgeQuote.bridge_id, from_token_id: fromToken.id, @@ -156,6 +156,7 @@ export const BridgeContent = () => { .toString(), to_chain_id: toToken.chain, to_token_id: toToken.id, + slippage: new BigNumber(slippageState).div(100).toString(10), }), { retries: 1 } ); @@ -233,6 +234,7 @@ export const BridgeContent = () => { wallet, amount, rbiSource, + slippageState, ]); const buildTxs = useMemoizedFn(async () => { diff --git a/src/ui/views/Bridge/Component/BridgeSlippage.tsx b/src/ui/views/Bridge/Component/BridgeSlippage.tsx index 154dcf4728d..d75c838e6a9 100644 --- a/src/ui/views/Bridge/Component/BridgeSlippage.tsx +++ b/src/ui/views/Bridge/Component/BridgeSlippage.tsx @@ -31,6 +31,7 @@ const SlippageItem = styled.div` background: var(--r-neutral-card-1, #fff); border-radius: 6px; overflow: hidden; + color: var(--r-neutral-title1, #192945); &.input-wrapper { border: 1px solid var(--r-neutral-line, #e0e5ec); diff --git a/src/ui/views/Bridge/Component/BridgeToken.tsx b/src/ui/views/Bridge/Component/BridgeToken.tsx index d144bcb81ac..3acf158e268 100644 --- a/src/ui/views/Bridge/Component/BridgeToken.tsx +++ b/src/ui/views/Bridge/Component/BridgeToken.tsx @@ -83,8 +83,9 @@ export const BridgeToken = ({ const supportedChains = useRabbySelector((s) => s.bridge.supportedChains); const isFromToken = type === 'from'; + const isToken = type === 'to'; - const name = type === 'from' ? t('page.bridge.From') : t('page.bridge.To'); + const name = isFromToken ? t('page.bridge.From') : t('page.bridge.To'); const chainObj = findChainByEnum(chain); const openFeePopup = useSetSettingVisible(); @@ -92,17 +93,14 @@ export const BridgeToken = ({ const inputRef = useRef(); useLayoutEffect(() => { - if (type === 'from') { + if (isFromToken) { if (document?.activeElement !== inputRef.current?.input) { inputRef.current?.focus(); } } }, [value]); - const showNoQuote = useMemo(() => type === 'to' && !!noQuote, [ - type, - noQuote, - ]); + const showNoQuote = useMemo(() => isToken && !!noQuote, [type, noQuote]); const useValue = useMemo(() => { if (token && value) { @@ -174,7 +172,7 @@ export const BridgeToken = ({ ref={inputRef as any} /> )} - {type === 'to' ? ( + {isToken ? ( - {useValue} - {type === 'to' && !!value && ( + {valueLoading ? ( + + ) : ( + {useValue} + )} + {isToken && !!value && ( openFeePopup(true)} viewBox="0 0 14 14"