@rango-dev/widget-embedded 0.44.2-next.1 → 0.44.2-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/pages/Home.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import { SameTokensWarning } from '../components/SameTokensWarning';
|
|
|
13
13
|
import { SlippageWarningsAndErrors } from '../components/SlippageWarningsAndErrors/SlippageWarningsAndErrors';
|
|
14
14
|
import { SwapMetrics } from '../components/SwapMetrics';
|
|
15
15
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
16
|
+
import { SLIPPAGES } from '../constants/swapSettings';
|
|
16
17
|
import { ExpandedQuotes } from '../containers/ExpandedQuotes';
|
|
17
18
|
import { Inputs } from '../containers/Inputs';
|
|
18
19
|
import { QuoteInfo } from '../containers/QuoteInfo';
|
|
@@ -136,10 +137,15 @@ export function Home() {
|
|
|
136
137
|
};
|
|
137
138
|
|
|
138
139
|
const onChangeSlippage = (slippage: number | null) => {
|
|
139
|
-
if (slippage) {
|
|
140
|
+
if (!slippage) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (SLIPPAGES.includes(slippage)) {
|
|
140
144
|
setSlippage(slippage);
|
|
141
145
|
setCustomSlippage(null);
|
|
146
|
+
return;
|
|
142
147
|
}
|
|
148
|
+
setCustomSlippage(slippage);
|
|
143
149
|
};
|
|
144
150
|
|
|
145
151
|
useEffect(() => {
|
|
@@ -12,7 +12,7 @@ const FAKER_SEED = 14;
|
|
|
12
12
|
const THREE_MAX_DECIMAL = 3;
|
|
13
13
|
const FOUR_MAX_DECIMAL = 4;
|
|
14
14
|
const SMALL_INT = { min: 1, max: 9 };
|
|
15
|
-
const FLOAT_OPTS = { min: 0, max: 100,
|
|
15
|
+
const FLOAT_OPTS = { min: 0, max: 100, multipleOf: 0.01 };
|
|
16
16
|
faker.seed(FAKER_SEED);
|
|
17
17
|
|
|
18
18
|
describe('check validation behaviors', () => {
|