Skip to content

Commit

Permalink
[Issue-2780] WebApp - Bug related to Swap feature
Browse files Browse the repository at this point in the history
  • Loading branch information
dungnguyen-art committed Aug 6, 2024
1 parent 637ae33 commit 5e2ad2b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,14 @@ const Component: React.FC<Props> = (props: Props) => {
<Number
decimal={0}
suffix={_getAssetSymbol(fromAssetInfo)}
unitOpacity={0.45}
value={1}
/>
<span>&nbsp;~&nbsp;</span>
<Number
decimal={0}
suffix={_getAssetSymbol(toAssetInfo)}
unitOpacity={0.45}
value={data.quote.rate}
/>
</div>
Expand Down
12 changes: 10 additions & 2 deletions packages/extension-web-ui/src/Popup/Transaction/variants/Swap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { _getAssetDecimals, _getAssetOriginChain, _getAssetPriceId, _getAssetSym
import { getSwapAlternativeAsset } from '@subwallet/extension-base/services/swap-service/utils';
import { SWTransactionResponse } from '@subwallet/extension-base/services/transaction-service/types';
import { CommonFeeComponent, CommonOptimalPath, CommonStepType } from '@subwallet/extension-base/types/service-base';
import { SlippageType, SwapFeeType, SwapProviderId, SwapQuote, SwapRequest } from '@subwallet/extension-base/types/swap';
import { SlippageType, SwapFeeType, SwapProviderId, SwapQuote, SwapRequest, SwapStepType } from '@subwallet/extension-base/types/swap';
import { formatNumberString, isAccountAll, swapCustomFormatter } from '@subwallet/extension-base/utils';
import { AccountSelector, AddMoreBalanceModal, AddressInput, AlertBox, ChooseFeeTokenModal, HiddenInput, MetaInfo, PageWrapper, QuoteResetTime, SlippageModal, SwapFromField, SwapIdleWarningModal, SwapQuotesSelectorModal, SwapRoute, SwapTermsOfServiceModal, SwapToField } from '@subwallet/extension-web-ui/components';
import { BN_TEN, BN_ZERO, CONFIRM_SWAP_TERM, DEFAULT_SWAP_PARAMS, SWAP_ALL_QUOTES_MODAL, SWAP_CHOOSE_FEE_TOKEN_MODAL, SWAP_IDLE_WARNING_MODAL, SWAP_MORE_BALANCE_MODAL, SWAP_SLIPPAGE_MODAL, SWAP_TERMS_OF_SERVICE_MODAL } from '@subwallet/extension-web-ui/constants';
Expand Down Expand Up @@ -647,7 +647,7 @@ const Component = () => {
let latestOptimalQuote = currentQuote;

if (currentOptimalSwapPath.steps.length > 2 &&
(currentOptimalSwapPath.steps[step].type === SwapStepType.SET_FEE_TOKEN || currentOptimalSwapPath.steps[step].type === SwapStepType.SWAP)) {
(currentOptimalSwapPath.steps[step].type === CommonStepType.SET_FEE_TOKEN || currentOptimalSwapPath.steps[step].type === SwapStepType.SWAP)) {
if (currentQuoteRequest) {
const latestSwapQuote = await getLatestSwapQuote(currentQuoteRequest);

Expand Down Expand Up @@ -1948,6 +1948,14 @@ const Swap = styled(Wrapper)<Props>(({ theme: { token } }: Props) => {
lineHeight: token.colorTextLight2
}
},
'.__minimum-received .ant-number-suffix': {
color: `${token.colorTextTertiary} !important`
},
'.__balance-display-area': {
'.ant-number-integer, .ant-number-decimal': {
color: `${token.colorWhite} !important`
}
},
'.__quote-fee-block': {
marginTop: token.marginXS,
fontSize: token.fontSize,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Component: React.FC<TransferInfoItem> = (props: TransferInfoItem) => {
? (
<ChainItem
chain={originChain.slug}
label={t('Networks')}
label={t('Network')}
/>
)
: (
Expand Down

0 comments on commit 5e2ad2b

Please sign in to comment.