diff --git a/.changeset/plenty-buckets-act.md b/.changeset/plenty-buckets-act.md new file mode 100644 index 00000000..a5c6942f --- /dev/null +++ b/.changeset/plenty-buckets-act.md @@ -0,0 +1,5 @@ +--- +'@reservoir0x/relay-kit-ui': patch +--- + +Hide route selector in fee breakdown in single chain mode diff --git a/packages/ui/src/components/widgets/FeeBreakdown.tsx b/packages/ui/src/components/widgets/FeeBreakdown.tsx index b2e330b7..4ec88bd5 100644 --- a/packages/ui/src/components/widgets/FeeBreakdown.tsx +++ b/packages/ui/src/components/widgets/FeeBreakdown.tsx @@ -23,6 +23,7 @@ type Props = Pick< | 'canonicalTimeEstimate' > & { toChain?: RelayChain + isSingleChainLocked?: boolean } const formatSwapRate = (rate: number) => { @@ -40,7 +41,8 @@ const FeeBreakdown: FC = ({ useExternalLiquidity, setUseExternalLiquidity, timeEstimate, - canonicalTimeEstimate + canonicalTimeEstimate, + isSingleChainLocked }) => { const swapRate = price?.details?.rate const originGasFee = feeBreakdown?.breakdown?.find( @@ -86,16 +88,20 @@ const FeeBreakdown: FC = ({ mb: '6px' }} > - { - setUseExternalLiquidity(selected) - }} - canonicalTimeEstimate={canonicalTimeEstimate?.formattedTime} - /> - + {!isSingleChainLocked ? ( + <> + { + setUseExternalLiquidity(selected) + }} + canonicalTimeEstimate={canonicalTimeEstimate?.formattedTime} + /> + + + ) : null} = ({ isSingleChainLocked ? [lockChainId] : fromToken?.chainId !== undefined && - fromToken?.chainId === lockChainId - ? [fromToken?.chainId] - : undefined + fromToken?.chainId === lockChainId + ? [fromToken?.chainId] + : undefined } restrictedTokensList={tokens?.filter( (token) => token.chainId === fromToken?.chainId @@ -765,9 +765,9 @@ const SwapWidget: FC = ({ isSingleChainLocked ? [lockChainId] : toToken?.chainId !== undefined && - toToken?.chainId === lockChainId - ? [toToken?.chainId] - : undefined + toToken?.chainId === lockChainId + ? [toToken?.chainId] + : undefined } restrictedTokensList={tokens?.filter( (token) => token.chainId === toToken?.chainId @@ -883,6 +883,7 @@ const SwapWidget: FC = ({ }) }} canonicalTimeEstimate={canonicalTimeEstimate} + isSingleChainLocked={isSingleChainLocked} />