Skip to content

Commit 44bcfb3

Browse files
authored
Merge pull request #1751 from balancednetwork/fix/fix-swap-ui
Fix swap UI
2 parents e0f8c27 + d1df954 commit 44bcfb3

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎apps/web/src/app/components/CurrencyInputPanel/index.tsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@ import { SelectorPopover } from '@/app/components/Popover';
1010
import DropDown from '@/assets/icons/arrow-down.svg';
1111
import useWidth from '@/hooks/useWidth';
1212
import { getSupportedXChainForIntentToken } from '@/lib/sodax/utils';
13+
import { useTokenPricesWithPyth } from '@/queries/backendv2';
1314
import { COMMON_PERCENTS } from '@/store/swap/reducer';
1415
import { escapeRegExp } from '@/utils';
1516
import { formatBalance, formatSymbol } from '@/utils/formatter';
1617
import {
1718
DEFAULT_TOKEN_CHAIN,
19+
convertCurrency,
1820
getSupportedXChainForSwapToken,
1921
getSupportedXChainIdsForSwapToken,
2022
icon,
21-
sui,
2223
stellar,
23-
convertCurrency,
24+
sui,
2425
} from '@balancednetwork/xwagmi';
2526
import { XChainId } from '@balancednetwork/xwagmi';
2627
import { isMobile } from 'react-device-detect';
@@ -29,7 +30,6 @@ import { CurrencySelectionType } from '../SearchModal/CurrencySearch';
2930
import CurrencySearchModal from '../SearchModal/CurrencySearchModal';
3031
import CrossChainOptions from '../trade/CrossChainOptions';
3132
import DollarValue from './DollarValue';
32-
import { useTokenPricesWithPyth } from '@/queries/backendv2';
3333

3434
const InputContainer = styled.div`
3535
display: inline-flex;
@@ -76,7 +76,7 @@ const NumberInput = styled.input<{ bg?: string; $active?: boolean; $showDollarVa
7676
border-radius: 0 10px 10px 0;
7777
border: ${({ theme, bg = 'bg2' }) => `2px solid ${theme.colors[bg]}`};
7878
background-color: ${({ theme, bg = 'bg2' }) => `${theme.colors[bg]}`};
79-
color: ${({ disabled, theme }) => (disabled ? theme.colors.text2 : '#ffffff')};
79+
color: #ffffff;
8080
padding: ${({ $showDollarValue }) => ($showDollarValue ? '1px 15px 20px' : '7px 15px')};
8181
outline: none;
8282
transition: all 0.3s ease;
@@ -277,11 +277,11 @@ export default function CurrencyInputPanel({
277277

278278
<NumberInput
279279
placeholder={placeholder}
280-
value={!percent ? value : price ? formatBalance(value, price.toFixed()) : value}
280+
value={!percent ? value : price ? formatBalance(value, price.toFixed()).replace(/,/g, '') : value}
281281
onClick={() => setIsActive(!isActive)}
282282
onBlur={() => setIsActive(false)}
283283
onChange={event => {
284-
enforcer(event.target.value.replace(/,/g, '.'));
284+
enforcer(event.target.value.replace(/,/g, ''));
285285
}}
286286
disabled={disabled}
287287
// universal input options

‎apps/web/src/app/pages/trade/xswap/_components/SwapPanel.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ export default function SwapPanel() {
210210
setManualAddress={setManualAddress}
211211
showWarning={false}
212212
currencySelectionType={CurrencySelectionType.SODAX_TRADE_OUT}
213+
disabled={true}
213214
/>
214215
</Flex>
215216
</AutoColumn>

‎apps/web/src/store/swap/reducer.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ const swapSlice = createSlice({
119119

120120
return {
121121
...state,
122-
independentField: state.independentField === Field.INPUT ? Field.OUTPUT : Field.INPUT,
123122
[Field.INPUT]: { ...state[Field.OUTPUT], currency: outputCurrency, percent: 0 },
124123
[Field.OUTPUT]: { ...state[Field.INPUT], currency: inputCurrency },
125124
};

0 commit comments

Comments
 (0)