Skip to content

Commit

Permalink
chore: update rate text limit order (#2367)
Browse files Browse the repository at this point in the history
  • Loading branch information
nguyenhoaidanh authored Nov 7, 2023
1 parent 244d3d6 commit 5c9460e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/swapv2/LimitOrder/DeltaRate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ const DeltaRate = ({
marketPrice,
rateInfo,
symbol,
invert,
}: {
marketPrice: BaseTradeInfo | undefined
rateInfo: RateInfo
symbol: string
invert: boolean
}) => {
const theme = useTheme()

Expand All @@ -65,7 +67,7 @@ const DeltaRate = ({
)
return (
<Label style={{ display: 'flex', alignItems: 'center', whiteSpace: 'nowrap' }}>
<Trans>Sell {symbol} at rate</Trans>
{invert ? <Trans>Buy {symbol} at rate</Trans> : <Trans>Sell {symbol} at rate</Trans>}
{percent ? (
<>
<Text as="span" color={color}>
Expand Down
3 changes: 2 additions & 1 deletion src/components/swapv2/LimitOrder/LimitOrderForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ const LimitOrderForm = forwardRef<LimitOrderFormHandle, Props>(function LimitOrd
<InputWrapper>
<Flex justifyContent={'space-between'} alignItems="center">
<DeltaRate
invert={rateInfo.invert}
symbol={(rateInfo.invert ? currencyOut?.symbol : currencyIn?.symbol) ?? ''}
marketPrice={tradeInfo}
rateInfo={rateInfo}
Expand All @@ -764,7 +765,7 @@ const LimitOrderForm = forwardRef<LimitOrderFormHandle, Props>(function LimitOrd
{currencyIn && currencyOut && (
<Flex style={{ gap: 6, cursor: 'pointer' }} onClick={() => onInvertRate(!rateInfo.invert)}>
<CurrencyLogo size={'18px'} currency={rateInfo.invert ? currencyIn : currencyOut} />
<Text fontSize={14} color={theme.subText}>
<Text fontSize={14} color={theme.subText} sx={{ userSelect: 'none' }}>
{rateInfo.invert ? currencyIn?.symbol : currencyOut?.symbol}
</Text>
<div>
Expand Down

0 comments on commit 5c9460e

Please sign in to comment.