@rabbitio/ui-kit 1.0.0-beta.46 → 1.0.0-beta.48
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/coverage/clover.xml +7 -22
- package/coverage/coverage-final.json +2 -2
- package/coverage/index.html +9 -9
- package/coverage/rabbit-ui-kit/index.html +1 -1
- package/coverage/rabbit-ui-kit/index.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/adapters/axiosAdapter.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/adapters/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/amountUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/errorUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/external-apis/apiGroups.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/external-apis/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/external-apis/ipAddressProviders.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/fiatCurrenciesService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/models/blockchain.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/models/coin.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/models/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/models/protocol.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/cache.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/emailAPI.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/logging/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/logging/logger.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/logging/logsStorage.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/postponeExecution.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/common/utils/safeStringify.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetIcon/AssetIcon.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetIcon/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetSelection/AssetSelection.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/AssetSelection/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/BackgroundTitle/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/LoadingDots/LoadingDots.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/LoadingDots/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/NoticeIcon/NoticeIcon.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/NoticeIcon/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/SupportChat/SupportChat.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/SupportChat/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/TitleBox/TitleBox.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/TitleBox/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/Tooltip/Tooltip.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/Tooltip/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/Validation/Validation.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/Validation/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Button/Button.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Button/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Close/Close.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/Close/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/LinkButton/LinkButton.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/atoms/buttons/LinkButton/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/hooks/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/hooks/useCallHandlingErrors.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/hooks/useReferredState.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/molecules/AmountInput/AmountInput.jsx.html +5 -47
- package/coverage/rabbit-ui-kit/src/components/molecules/AmountInput/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/Dialog.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogButtons/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/DialogStep/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/organisms/Dialog/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/organisms/SwapForm/SwapForm.jsx.html +5 -8
- package/coverage/rabbit-ui-kit/src/components/organisms/SwapForm/index.html +5 -5
- package/coverage/rabbit-ui-kit/src/components/utils/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/utils/inputValueProviders.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/utils/textUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/utils/uiUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/components/utils/urlQueryUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/DialogStep/dialogStep.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/DialogStep/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/dialog.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/constants/organisms/dialog/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/index.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/cacheAndConcurrentRequestsResolver.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/cachedRobustExternalApiCallerService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/cancelProcessing.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/concurrentCalculationsMetadataHolder.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/externalApiProvider.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/externalServicesStatsCollector.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/robustExteranlApiCallerService/robustExternalAPICallerService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwap.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/publicSwapService.js.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/index.html +1 -1
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/swapUtils.js.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/LoadingDots.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/Validation.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Button.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Close.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/atoms/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/index.html +1 -1
- package/coverage/rabbit-ui-kit/stories/stubs/exampleContent.jsx.html +1 -1
- package/coverage/rabbit-ui-kit/stories/stubs/index.html +1 -1
- package/dist/index.cjs +112 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +139 -144
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +139 -144
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +112 -117
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/AmountInput/AmountInput.jsx +1 -15
- package/src/components/organisms/SwapForm/SwapForm.jsx +1 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var React
|
|
1
|
+
var React = require('react');
|
|
2
2
|
var reactTransitionGroup = require('react-transition-group');
|
|
3
3
|
var AnimateHeight = require('react-animate-height');
|
|
4
4
|
var ResizeObserver = require('resize-observer-polyfill');
|
|
@@ -13,7 +13,7 @@ var uuid = require('uuid');
|
|
|
13
13
|
|
|
14
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
15
|
|
|
16
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
17
|
var AnimateHeight__default = /*#__PURE__*/_interopDefaultLegacy(AnimateHeight);
|
|
18
18
|
var ResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(ResizeObserver);
|
|
19
19
|
var animateScrollTo__default = /*#__PURE__*/_interopDefaultLegacy(animateScrollTo);
|
|
@@ -1284,23 +1284,23 @@ var Button = function Button(_ref) {
|
|
|
1284
1284
|
handleError = _ref$handleError === void 0 ? function (func, event) {
|
|
1285
1285
|
return func(event);
|
|
1286
1286
|
} : _ref$handleError;
|
|
1287
|
-
var _useState = React
|
|
1287
|
+
var _useState = React.useState(loading),
|
|
1288
1288
|
isLoading = _useState[0],
|
|
1289
1289
|
setIsLoading = _useState[1];
|
|
1290
|
-
var _useState2 = React
|
|
1290
|
+
var _useState2 = React.useState(false),
|
|
1291
1291
|
isCheckShown = _useState2[0],
|
|
1292
1292
|
setIsCheckShown = _useState2[1];
|
|
1293
|
-
var _useState3 = React
|
|
1293
|
+
var _useState3 = React.useState(null),
|
|
1294
1294
|
event = _useState3[0],
|
|
1295
1295
|
setEvent = _useState3[1];
|
|
1296
|
-
var buttonRef = React
|
|
1297
|
-
React
|
|
1296
|
+
var buttonRef = React.useRef();
|
|
1297
|
+
React.useEffect(function () {
|
|
1298
1298
|
setClickTrigger(function () {
|
|
1299
1299
|
return buttonRef.current.click();
|
|
1300
1300
|
});
|
|
1301
1301
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1302
1302
|
}, [buttonRef]);
|
|
1303
|
-
React
|
|
1303
|
+
React.useEffect(function () {
|
|
1304
1304
|
if (isLoading) {
|
|
1305
1305
|
onClick(function () {
|
|
1306
1306
|
return setIsLoading(false);
|
|
@@ -1425,7 +1425,7 @@ var SupportChat = function SupportChat(_ref) {
|
|
|
1425
1425
|
welcomeMessage = _ref$welcomeMessage === void 0 ? "" : _ref$welcomeMessage,
|
|
1426
1426
|
_ref$locale = _ref.locale,
|
|
1427
1427
|
locale = _ref$locale === void 0 ? "en" : _ref$locale;
|
|
1428
|
-
React
|
|
1428
|
+
React.useEffect(function () {
|
|
1429
1429
|
window.chatwootSettings = {
|
|
1430
1430
|
position: "right",
|
|
1431
1431
|
type: "standard",
|
|
@@ -1652,9 +1652,9 @@ function _catch$a(body, recover) {
|
|
|
1652
1652
|
return result;
|
|
1653
1653
|
}
|
|
1654
1654
|
function useCallHandlingErrors() {
|
|
1655
|
-
var _useState = React
|
|
1655
|
+
var _useState = React.useState(),
|
|
1656
1656
|
setState = _useState[1];
|
|
1657
|
-
return React
|
|
1657
|
+
return React.useCallback(function (functionToBeCalled, event) {
|
|
1658
1658
|
try {
|
|
1659
1659
|
var _temp = _catch$a(function () {
|
|
1660
1660
|
return Promise.resolve(functionToBeCalled(event)).then(function () {});
|
|
@@ -1713,10 +1713,10 @@ var LinkButton = function LinkButton(_ref) {
|
|
|
1713
1713
|
iconRotate = _ref.iconRotate,
|
|
1714
1714
|
IconComponent = _ref.IconComponent;
|
|
1715
1715
|
var callHandlingErrors = useCallHandlingErrors();
|
|
1716
|
-
var _useState = React
|
|
1716
|
+
var _useState = React.useState(false),
|
|
1717
1717
|
isLoading = _useState[0],
|
|
1718
1718
|
setIsLoading = _useState[1];
|
|
1719
|
-
var _useState2 = React
|
|
1719
|
+
var _useState2 = React.useState(null),
|
|
1720
1720
|
processedIconRotation = _useState2[0],
|
|
1721
1721
|
setProcessedIconRotation = _useState2[1];
|
|
1722
1722
|
var handleClick = function handleClick() {
|
|
@@ -1732,7 +1732,7 @@ var LinkButton = function LinkButton(_ref) {
|
|
|
1732
1732
|
}
|
|
1733
1733
|
});
|
|
1734
1734
|
};
|
|
1735
|
-
React
|
|
1735
|
+
React.useEffect(function () {
|
|
1736
1736
|
if (iconRotate && Object.keys(iconRotateOptions).find(function (key) {
|
|
1737
1737
|
return iconRotateOptions[key] === iconRotate;
|
|
1738
1738
|
})) setProcessedIconRotation(iconRotate);
|
|
@@ -2263,22 +2263,22 @@ var Dialog = function Dialog(_ref) {
|
|
|
2263
2263
|
secondaryButtonTo: null,
|
|
2264
2264
|
fixedButtonsEnabled: false
|
|
2265
2265
|
};
|
|
2266
|
-
var _useState = React
|
|
2266
|
+
var _useState = React.useState(false),
|
|
2267
2267
|
showDialogProcessed = _useState[0],
|
|
2268
2268
|
setShowDialogProcessed = _useState[1];
|
|
2269
|
-
var _useState2 = React
|
|
2269
|
+
var _useState2 = React.useState(0),
|
|
2270
2270
|
currentStep = _useState2[0],
|
|
2271
2271
|
setCurrentStep = _useState2[1];
|
|
2272
|
-
var _useState3 = React
|
|
2272
|
+
var _useState3 = React.useState(null),
|
|
2273
2273
|
steps = _useState3[0],
|
|
2274
2274
|
setSteps = _useState3[1];
|
|
2275
|
-
var _useState4 = React
|
|
2275
|
+
var _useState4 = React.useState({
|
|
2276
2276
|
cornerBackButtonTitle: "",
|
|
2277
2277
|
customWidth: width !== "" ? width : DIALOG_SIZES.small.width
|
|
2278
2278
|
}),
|
|
2279
2279
|
dialogConfiguration = _useState4[0],
|
|
2280
2280
|
updateDialogConfiguration = _useState4[1];
|
|
2281
|
-
var _useState5 = React
|
|
2281
|
+
var _useState5 = React.useState({
|
|
2282
2282
|
animateHeightDelay: DIALOG_TRANSITION_STEP_DURATION * 2,
|
|
2283
2283
|
animateHeightTransitionSpeed: DIALOG_TRANSITION_STEP_DURATION,
|
|
2284
2284
|
animateHeightTransitionEnabled: false,
|
|
@@ -2291,38 +2291,38 @@ var Dialog = function Dialog(_ref) {
|
|
|
2291
2291
|
}),
|
|
2292
2292
|
animationConfiguration = _useState5[0],
|
|
2293
2293
|
updateAnimationConfiguration = _useState5[1];
|
|
2294
|
-
var _useState6 = React
|
|
2294
|
+
var _useState6 = React.useState(0),
|
|
2295
2295
|
stepAnimationFinishedTrigger = _useState6[0],
|
|
2296
2296
|
setStepAnimationFinishedTrigger = _useState6[1];
|
|
2297
|
-
var _useState7 = React
|
|
2297
|
+
var _useState7 = React.useState(300),
|
|
2298
2298
|
dialogVerticalHeight = _useState7[0],
|
|
2299
2299
|
setDialogVerticalHeight = _useState7[1];
|
|
2300
|
-
var _useState8 = React
|
|
2300
|
+
var _useState8 = React.useState({}),
|
|
2301
2301
|
currentStepRef = _useState8[0],
|
|
2302
2302
|
setCurrentStepRef = _useState8[1];
|
|
2303
|
-
var _useState9 = React
|
|
2303
|
+
var _useState9 = React.useState({
|
|
2304
2304
|
width: 0,
|
|
2305
2305
|
height: 0
|
|
2306
2306
|
}),
|
|
2307
2307
|
dimensions = _useState9[0],
|
|
2308
2308
|
setDimensions = _useState9[1];
|
|
2309
|
-
var _useState10 = React
|
|
2309
|
+
var _useState10 = React.useState(buttonsConfigurationDefault),
|
|
2310
2310
|
buttonsConfiguration = _useState10[0],
|
|
2311
2311
|
updateButtonsConfigurationState = _useState10[1];
|
|
2312
2312
|
var _useReferredState = useReferredState(""),
|
|
2313
2313
|
buttonControllingStep = _useReferredState[0],
|
|
2314
2314
|
updateButtonControllingStep = _useReferredState[1];
|
|
2315
|
-
var _useState11 = React
|
|
2315
|
+
var _useState11 = React.useState(false),
|
|
2316
2316
|
isMultiStep = _useState11[0],
|
|
2317
2317
|
setIsMultiStep = _useState11[1];
|
|
2318
|
-
var dialogWrapperRef = React
|
|
2319
|
-
var dialogRef = React
|
|
2320
|
-
var scrollableRef = React
|
|
2321
|
-
var resizeObserverRef = React
|
|
2318
|
+
var dialogWrapperRef = React.useRef();
|
|
2319
|
+
var dialogRef = React.useRef();
|
|
2320
|
+
var scrollableRef = React.useRef();
|
|
2321
|
+
var resizeObserverRef = React.useRef(null);
|
|
2322
2322
|
var updateButtonsConfiguration = function updateButtonsConfiguration(newConfiguration, stepName) {
|
|
2323
2323
|
if (buttonControllingStep.current === stepName || buttonControllingStep.current === "") updateButtonsConfigurationState(newConfiguration);
|
|
2324
2324
|
};
|
|
2325
|
-
React
|
|
2325
|
+
React.useEffect(function () {
|
|
2326
2326
|
if (showDialog) disableAnimation();
|
|
2327
2327
|
setShowDialogProcessed(showDialog);
|
|
2328
2328
|
showDialog ? dispatchDialogOpened() : dispatchDialogClosed();
|
|
@@ -2432,7 +2432,7 @@ var Dialog = function Dialog(_ref) {
|
|
|
2432
2432
|
});
|
|
2433
2433
|
}
|
|
2434
2434
|
};
|
|
2435
|
-
React
|
|
2435
|
+
React.useEffect(function () {
|
|
2436
2436
|
if (animationConfiguration.triggerAnimationFinishedDispatcher) {
|
|
2437
2437
|
setStepAnimationFinishedTrigger(function (prev) {
|
|
2438
2438
|
return prev + 1;
|
|
@@ -2472,7 +2472,7 @@ var Dialog = function Dialog(_ref) {
|
|
|
2472
2472
|
var clearButtonsConfiguration = function clearButtonsConfiguration() {
|
|
2473
2473
|
updateButtonsConfigurationState(buttonsConfigurationDefault);
|
|
2474
2474
|
};
|
|
2475
|
-
React
|
|
2475
|
+
React.useEffect(function () {
|
|
2476
2476
|
initControls && initControls(function (prev) {
|
|
2477
2477
|
return _extends({}, prev, {
|
|
2478
2478
|
stepAnimationFinishedTrigger: stepAnimationFinishedTrigger
|
|
@@ -2480,7 +2480,7 @@ var Dialog = function Dialog(_ref) {
|
|
|
2480
2480
|
});
|
|
2481
2481
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2482
2482
|
}, [stepAnimationFinishedTrigger]);
|
|
2483
|
-
React
|
|
2483
|
+
React.useEffect(function () {
|
|
2484
2484
|
initControls && initControls(function (prev) {
|
|
2485
2485
|
return _extends({}, prev, {
|
|
2486
2486
|
animationConfiguration: animationConfiguration
|
|
@@ -2488,7 +2488,7 @@ var Dialog = function Dialog(_ref) {
|
|
|
2488
2488
|
});
|
|
2489
2489
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2490
2490
|
}, [animationConfiguration]);
|
|
2491
|
-
React
|
|
2491
|
+
React.useEffect(function () {
|
|
2492
2492
|
if (currentStepRef.current) {
|
|
2493
2493
|
resizeObserverRef.current = new ResizeObserver__default["default"](function (entries) {
|
|
2494
2494
|
if (entries === void 0) {
|
|
@@ -2511,13 +2511,13 @@ var Dialog = function Dialog(_ref) {
|
|
|
2511
2511
|
}
|
|
2512
2512
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2513
2513
|
}, [currentStepRef]);
|
|
2514
|
-
React
|
|
2514
|
+
React.useEffect(function () {
|
|
2515
2515
|
setDialogVerticalHeight(function (prev) {
|
|
2516
2516
|
return prev !== 0 && dimensions.height === 0 ? prev : dimensions.height;
|
|
2517
2517
|
});
|
|
2518
2518
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2519
2519
|
}, [dimensions]);
|
|
2520
|
-
React
|
|
2520
|
+
React.useEffect(function () {
|
|
2521
2521
|
var childrenFormatted = children.length > 1 ? children : [children];
|
|
2522
2522
|
var stepsArr = childrenFormatted.map(function (child) {
|
|
2523
2523
|
return {
|
|
@@ -2529,11 +2529,11 @@ var Dialog = function Dialog(_ref) {
|
|
|
2529
2529
|
|
|
2530
2530
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2531
2531
|
}, []);
|
|
2532
|
-
React
|
|
2532
|
+
React.useEffect(function () {
|
|
2533
2533
|
setIsMultiStep(typeof initControls === "function");
|
|
2534
2534
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2535
2535
|
}, [initControls]);
|
|
2536
|
-
React
|
|
2536
|
+
React.useEffect(function () {
|
|
2537
2537
|
if (steps) initControls && initControls({
|
|
2538
2538
|
nextStep: nextStep,
|
|
2539
2539
|
previousStep: previousStep,
|
|
@@ -2559,7 +2559,7 @@ var Dialog = function Dialog(_ref) {
|
|
|
2559
2559
|
});
|
|
2560
2560
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2561
2561
|
}, [currentStep, steps]);
|
|
2562
|
-
React
|
|
2562
|
+
React.useEffect(function () {
|
|
2563
2563
|
return function () {
|
|
2564
2564
|
bodyScrollLock.clearAllBodyScrollLocks();
|
|
2565
2565
|
updateButtonControllingStep("");
|
|
@@ -2792,25 +2792,25 @@ var DialogStep = function DialogStep(_ref) {
|
|
|
2792
2792
|
_controls$updateAnima = controls.updateAnimationConfiguration,
|
|
2793
2793
|
updateAnimationConfiguration = _controls$updateAnima === void 0 ? function () {} : _controls$updateAnima,
|
|
2794
2794
|
inline = controls.inline;
|
|
2795
|
-
var _useState = React
|
|
2795
|
+
var _useState = React.useState(false),
|
|
2796
2796
|
isMultiStep = _useState[0],
|
|
2797
2797
|
setIsMultiStep = _useState[1];
|
|
2798
|
-
var _useState2 = React
|
|
2798
|
+
var _useState2 = React.useState(""),
|
|
2799
2799
|
stepClass = _useState2[0],
|
|
2800
2800
|
setStepClass = _useState2[1];
|
|
2801
|
-
var _useState3 = React
|
|
2801
|
+
var _useState3 = React.useState(""),
|
|
2802
2802
|
wrapperDirectionSubclass = _useState3[0],
|
|
2803
2803
|
setWrapperDirectionSubclass = _useState3[1];
|
|
2804
|
-
var _useState4 = React
|
|
2804
|
+
var _useState4 = React.useState(0),
|
|
2805
2805
|
unmountOnAnimationEndTrigger = _useState4[0],
|
|
2806
2806
|
setUnmountOnAnimationEndTrigger = _useState4[1];
|
|
2807
|
-
var _useState5 = React
|
|
2807
|
+
var _useState5 = React.useState(false),
|
|
2808
2808
|
stepMounted = _useState5[0],
|
|
2809
2809
|
setStepMounted = _useState5[1];
|
|
2810
|
-
var currentStepRef = React
|
|
2810
|
+
var currentStepRef = React.useRef();
|
|
2811
2811
|
// const { t } = useTranslation();
|
|
2812
2812
|
|
|
2813
|
-
React
|
|
2813
|
+
React.useEffect(function () {
|
|
2814
2814
|
if (controls !== {} && stepName !== "") setIsMultiStep(true);
|
|
2815
2815
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2816
2816
|
}, []);
|
|
@@ -2825,7 +2825,7 @@ var DialogStep = function DialogStep(_ref) {
|
|
|
2825
2825
|
setUnmountOnAnimationEndTrigger(0);
|
|
2826
2826
|
}
|
|
2827
2827
|
};
|
|
2828
|
-
React
|
|
2828
|
+
React.useEffect(function () {
|
|
2829
2829
|
var multiStep = false;
|
|
2830
2830
|
if (controls !== {} && stepName !== "") {
|
|
2831
2831
|
setIsMultiStep(true);
|
|
@@ -2879,7 +2879,7 @@ var DialogStep = function DialogStep(_ref) {
|
|
|
2879
2879
|
}
|
|
2880
2880
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2881
2881
|
}, [currentStep]);
|
|
2882
|
-
React
|
|
2882
|
+
React.useEffect(function () {
|
|
2883
2883
|
if (isMultiStep && isCurrentStep(stepName) && fixedButtons && (confirmButtonText || backButtonText)) {
|
|
2884
2884
|
updateButtonsConfiguration({
|
|
2885
2885
|
primaryButtonTitle: confirmButtonText,
|
|
@@ -3249,11 +3249,11 @@ var NoticeIcon = function NoticeIcon(_ref) {
|
|
|
3249
3249
|
titleNoticeIcon = _ref$titleNoticeIcon === void 0 ? "" : _ref$titleNoticeIcon,
|
|
3250
3250
|
_ref$tooltipPosition = _ref.tooltipPosition,
|
|
3251
3251
|
tooltipPosition = _ref$tooltipPosition === void 0 ? TOOLTIP_POSITIONS.TOP : _ref$tooltipPosition;
|
|
3252
|
-
var _useState = React
|
|
3252
|
+
var _useState = React.useState(false),
|
|
3253
3253
|
showTooltip = _useState[0],
|
|
3254
3254
|
setShowTooltip = _useState[1];
|
|
3255
|
-
var noticeRef = React
|
|
3256
|
-
React
|
|
3255
|
+
var noticeRef = React.useRef();
|
|
3256
|
+
React.useEffect(function () {
|
|
3257
3257
|
return handleClickOutside([noticeRef], function () {
|
|
3258
3258
|
return setShowTooltip(false);
|
|
3259
3259
|
});
|
|
@@ -3358,7 +3358,7 @@ var TitleBox = function TitleBox(_ref) {
|
|
|
3358
3358
|
copyButtonTooltipContent = _ref.copyButtonTooltipContent;
|
|
3359
3359
|
var handleError = useCallHandlingErrors();
|
|
3360
3360
|
var transparentTitleClass = transparentTitle ? s$2["transparent-title"] : "";
|
|
3361
|
-
var _useState = React
|
|
3361
|
+
var _useState = React.useState(false),
|
|
3362
3362
|
showCopyNotice = _useState[0],
|
|
3363
3363
|
setShowCopyNotice = _useState[1];
|
|
3364
3364
|
var handleCopyButton = function handleCopyButton(e) {
|
|
@@ -3965,35 +3965,35 @@ var AmountInput = /*#__PURE__*/React__default["default"].forwardRef(function (_r
|
|
|
3965
3965
|
fiatInputPlaceholderText = _ref$fiatInputPlaceho === void 0 ? null : _ref$fiatInputPlaceho;
|
|
3966
3966
|
// const { t } = useTranslation();
|
|
3967
3967
|
var callHandlingErrors = useCallHandlingErrors();
|
|
3968
|
-
var _useState = React
|
|
3968
|
+
var _useState = React.useState(""),
|
|
3969
3969
|
coinAmountValue = _useState[0],
|
|
3970
3970
|
setCoinAmountValue = _useState[1];
|
|
3971
|
-
var _useState2 = React
|
|
3971
|
+
var _useState2 = React.useState("0"),
|
|
3972
3972
|
coinAmountPlaceholder = _useState2[0],
|
|
3973
3973
|
setCoinAmountPlaceholder = _useState2[1];
|
|
3974
|
-
var _useState3 = React
|
|
3974
|
+
var _useState3 = React.useState(""),
|
|
3975
3975
|
fiatAmountValue = _useState3[0],
|
|
3976
3976
|
setFiatAmountValue = _useState3[1];
|
|
3977
|
-
var _useState4 = React
|
|
3977
|
+
var _useState4 = React.useState(false),
|
|
3978
3978
|
interactedWith = _useState4[0],
|
|
3979
3979
|
setInteractedWith = _useState4[1];
|
|
3980
|
-
var _useState5 = React
|
|
3980
|
+
var _useState5 = React.useState(false),
|
|
3981
3981
|
fiatAmountAutoFocus = _useState5[0],
|
|
3982
3982
|
setFiatAmountAutoFocus = _useState5[1];
|
|
3983
|
-
var _useState6 = React
|
|
3983
|
+
var _useState6 = React.useState(false),
|
|
3984
3984
|
isInFocus = _useState6[0],
|
|
3985
3985
|
setIsInFocus = _useState6[1];
|
|
3986
|
-
var _useState7 = React
|
|
3986
|
+
var _useState7 = React.useState(false),
|
|
3987
3987
|
highlightBalance = _useState7[0],
|
|
3988
3988
|
setHighlightBalance = _useState7[1];
|
|
3989
|
-
var _useState8 = React
|
|
3989
|
+
var _useState8 = React.useState(false),
|
|
3990
3990
|
highlightInput = _useState8[0],
|
|
3991
3991
|
setHighlightInput = _useState8[1];
|
|
3992
3992
|
var resetToDefault = function resetToDefault() {
|
|
3993
3993
|
setInteractedWith(false);
|
|
3994
3994
|
setFiatAmountAutoFocus(false);
|
|
3995
3995
|
};
|
|
3996
|
-
React
|
|
3996
|
+
React.useEffect(function () {
|
|
3997
3997
|
if (updateAssetInputTo !== null) handleChangeAmount(updateAssetInputTo == null ? void 0 : updateAssetInputTo.toString(), false);
|
|
3998
3998
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3999
3999
|
}, [updateAssetInputTo]);
|
|
@@ -4049,11 +4049,11 @@ var AmountInput = /*#__PURE__*/React__default["default"].forwardRef(function (_r
|
|
|
4049
4049
|
setFiatAmountAutoFocus(true);
|
|
4050
4050
|
setInteractedWith(true);
|
|
4051
4051
|
};
|
|
4052
|
-
React
|
|
4052
|
+
React.useEffect(function () {
|
|
4053
4053
|
predefinedValue != null && handleChangeAmount(predefinedValue + "");
|
|
4054
4054
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4055
4055
|
}, [predefinedValue]);
|
|
4056
|
-
React
|
|
4056
|
+
React.useEffect(function () {
|
|
4057
4057
|
try {
|
|
4058
4058
|
setCoinAmountPlaceholder(placeholderByDecimalCount(assetDecimalPlaces));
|
|
4059
4059
|
} catch (e) {
|
|
@@ -4064,7 +4064,7 @@ var AmountInput = /*#__PURE__*/React__default["default"].forwardRef(function (_r
|
|
|
4064
4064
|
}, [ticker]);
|
|
4065
4065
|
|
|
4066
4066
|
// Check if input & balance highlights are needed after a change in either the asset amount or the balance
|
|
4067
|
-
React
|
|
4067
|
+
React.useEffect(function () {
|
|
4068
4068
|
if (!showBalanceValidation || (assetBalance == null ? void 0 : assetBalance.assetAmount) == null) return;
|
|
4069
4069
|
var enableHighlight = bignumber_js.BigNumber(coinAmountValue).gt(assetBalance == null ? void 0 : assetBalance.assetAmount);
|
|
4070
4070
|
handleBalanceValidationChange(enableHighlight);
|
|
@@ -4075,7 +4075,7 @@ var AmountInput = /*#__PURE__*/React__default["default"].forwardRef(function (_r
|
|
|
4075
4075
|
}, [coinAmountValue, assetBalance]);
|
|
4076
4076
|
|
|
4077
4077
|
// Clearing the custom focus upon disabling or enabling the form
|
|
4078
|
-
React
|
|
4078
|
+
React.useEffect(function () {
|
|
4079
4079
|
return setIsInFocus(false);
|
|
4080
4080
|
}, [disabled]);
|
|
4081
4081
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(TitleBox, {
|
|
@@ -4151,11 +4151,7 @@ var AmountInput = /*#__PURE__*/React__default["default"].forwardRef(function (_r
|
|
|
4151
4151
|
return handleFiatInteraction();
|
|
4152
4152
|
}, e);
|
|
4153
4153
|
}
|
|
4154
|
-
}, fiatInputPlaceholderText))) : /*#__PURE__*/React__default["default"].createElement(
|
|
4155
|
-
isColored: true,
|
|
4156
|
-
noMargins: false,
|
|
4157
|
-
align: "left"
|
|
4158
|
-
})), showChangeAssetButton && ticker ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4154
|
+
}, fiatInputPlaceholderText))) : null), showChangeAssetButton && ticker ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4159
4155
|
className: s$1["amount-input-container-button-wrapper"],
|
|
4160
4156
|
ref: buttonForwardRef
|
|
4161
4157
|
}, /*#__PURE__*/React__default["default"].createElement(AssetSelection, {
|
|
@@ -4439,16 +4435,16 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4439
4435
|
var DETAIL_REFRESH_INTERVAL_MS = 1.5 * 60000;
|
|
4440
4436
|
|
|
4441
4437
|
// Updating the states below will insert the new value into the send or receive input field
|
|
4442
|
-
var _useState = React
|
|
4438
|
+
var _useState = React.useState(preservedAmount != null ? preservedAmount : null),
|
|
4443
4439
|
updateSendInputTo = _useState[0],
|
|
4444
4440
|
setUpdateSendInputTo = _useState[1];
|
|
4445
|
-
var _useState2 = React
|
|
4441
|
+
var _useState2 = React.useState(null),
|
|
4446
4442
|
updateReceiveInputTo = _useState2[0],
|
|
4447
4443
|
setUpdateReceiveInputTo = _useState2[1];
|
|
4448
4444
|
var _useReferredState = useReferredState(preservedAmount == null || preservedAmount === "" ? null : preservedAmount),
|
|
4449
4445
|
sendAssetAmount = _useReferredState[0],
|
|
4450
4446
|
setSendAssetAmount = _useReferredState[1];
|
|
4451
|
-
var _useState3 = React
|
|
4447
|
+
var _useState3 = React.useState(),
|
|
4452
4448
|
swapRate = _useState3[0],
|
|
4453
4449
|
setSwapRate = _useState3[1];
|
|
4454
4450
|
var _useReferredState2 = useReferredState(null),
|
|
@@ -4457,48 +4453,48 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4457
4453
|
var _useReferredState3 = useReferredState(null),
|
|
4458
4454
|
maximumAmount = _useReferredState3[0],
|
|
4459
4455
|
setMaximumAmount = _useReferredState3[1];
|
|
4460
|
-
var _useState4 = React
|
|
4456
|
+
var _useState4 = React.useState(),
|
|
4461
4457
|
validationContent = _useState4[0],
|
|
4462
4458
|
setValidationContent = _useState4[1];
|
|
4463
|
-
var _useState5 = React
|
|
4459
|
+
var _useState5 = React.useState(true),
|
|
4464
4460
|
minimalAmountValid = _useState5[0],
|
|
4465
4461
|
setMinimalAmountValid = _useState5[1]; // Whether the amount is above the minimal amount
|
|
4466
|
-
var _useState6 = React
|
|
4462
|
+
var _useState6 = React.useState(true),
|
|
4467
4463
|
maximumAmountValid = _useState6[0],
|
|
4468
4464
|
setMaximumAmountValid = _useState6[1];
|
|
4469
|
-
var _useState7 = React
|
|
4465
|
+
var _useState7 = React.useState(true),
|
|
4470
4466
|
isPairSupported = _useState7[0],
|
|
4471
4467
|
setIsPairSupported = _useState7[1];
|
|
4472
|
-
var _useState8 = React
|
|
4468
|
+
var _useState8 = React.useState(false),
|
|
4473
4469
|
isSameCoins = _useState8[0],
|
|
4474
4470
|
setIsSameCoins = _useState8[1];
|
|
4475
|
-
var _useState9 = React
|
|
4471
|
+
var _useState9 = React.useState(false),
|
|
4476
4472
|
isSwapCalculated = _useState9[0],
|
|
4477
4473
|
setIsSwapCalculated = _useState9[1];
|
|
4478
|
-
var _useState10 = React
|
|
4474
|
+
var _useState10 = React.useState(false),
|
|
4479
4475
|
readyToSwap = _useState10[0],
|
|
4480
4476
|
setReadyToSwap = _useState10[1]; // Basically a param that enables/disables the "Next" button
|
|
4481
4477
|
// TODO: [refactoring, moderate] instead of handling preservedAmount at a lot of cases below, just
|
|
4482
4478
|
// write single useEffect setting sendAssetAmount to the=is passed value and simplify the logic below. task_id=6453251e49b04c5e88a3cc771479ffb5
|
|
4483
|
-
var _useState11 = React
|
|
4479
|
+
var _useState11 = React.useState(preservedAmount == null || String(preservedAmount) === "0"),
|
|
4484
4480
|
isAmountZero = _useState11[0],
|
|
4485
4481
|
setIsAmountZero = _useState11[1];
|
|
4486
4482
|
var _useReferredState4 = useReferredState(false),
|
|
4487
4483
|
isLoading = _useReferredState4[0],
|
|
4488
4484
|
setIsLoading = _useReferredState4[1]; // Whether the form is in the progress of loading some data (new rates, for example)
|
|
4489
|
-
var _useState12 = React
|
|
4485
|
+
var _useState12 = React.useState(composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, preservedAmount)),
|
|
4490
4486
|
confirmButtonTo = _useState12[0],
|
|
4491
4487
|
setConfirmButtonTo = _useState12[1];
|
|
4492
|
-
var _useState13 = React
|
|
4488
|
+
var _useState13 = React.useState(),
|
|
4493
4489
|
transactionFee = _useState13[0],
|
|
4494
4490
|
setTransactionFee = _useState13[1];
|
|
4495
|
-
var _useState14 = React
|
|
4491
|
+
var _useState14 = React.useState(true),
|
|
4496
4492
|
balanceValid = _useState14[0],
|
|
4497
4493
|
setBalanceValid = _useState14[1]; // Whether the amount is less than total balance
|
|
4498
4494
|
var _useReferredState5 = useReferredState(null),
|
|
4499
4495
|
isSwapAll = _useReferredState5[0],
|
|
4500
4496
|
setIsSwapAll = _useReferredState5[1];
|
|
4501
|
-
var _useState15 = React
|
|
4497
|
+
var _useState15 = React.useState([]),
|
|
4502
4498
|
swapAllButtonLoaderReSetter = _useState15[0],
|
|
4503
4499
|
setSwapAllButtonLoaderReSetter = _useState15[1];
|
|
4504
4500
|
var _useReferredState6 = useReferredState(null),
|
|
@@ -4715,7 +4711,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4715
4711
|
}
|
|
4716
4712
|
}, e);
|
|
4717
4713
|
};
|
|
4718
|
-
React
|
|
4714
|
+
React.useEffect(function () {
|
|
4719
4715
|
if (isSwapAll.current === true) {
|
|
4720
4716
|
requestDataRefresh(undefined, true);
|
|
4721
4717
|
} else if (isSwapAll.current === false) {
|
|
@@ -4723,11 +4719,11 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4723
4719
|
}
|
|
4724
4720
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4725
4721
|
}, [isSwapAll.current]);
|
|
4726
|
-
React
|
|
4722
|
+
React.useEffect(function () {
|
|
4727
4723
|
setConfirmButtonTo(composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, sendAssetAmount.current || preservedAmount || null));
|
|
4728
4724
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4729
4725
|
}, [sendingAssetTicker, receivingAssetTicker]);
|
|
4730
|
-
React
|
|
4726
|
+
React.useEffect(function () {
|
|
4731
4727
|
if (!sendingAssetTicker || !receivingAssetTicker) return;
|
|
4732
4728
|
var isCurrentAmountNotZero = sendAssetAmount.current && !bignumber_js.BigNumber("0").eq(sendAssetAmount.current);
|
|
4733
4729
|
var isPreservedAmountNotZero = preservedAmount && !bignumber_js.BigNumber("0").eq(preservedAmount);
|
|
@@ -4741,7 +4737,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4741
4737
|
|
|
4742
4738
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4743
4739
|
}, [sendingAssetTicker, receivingAssetTicker]);
|
|
4744
|
-
React
|
|
4740
|
+
React.useEffect(function () {
|
|
4745
4741
|
if (!minimalAmountValid || isAmountZero) {
|
|
4746
4742
|
setTransactionFee(null);
|
|
4747
4743
|
}
|
|
@@ -4752,7 +4748,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4752
4748
|
|
|
4753
4749
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4754
4750
|
}, [balanceValid, formHasBalance, minimalAmountValid, isAmountZero, isSwapCalculated, isSameCoins, isPairSupported]);
|
|
4755
|
-
React
|
|
4751
|
+
React.useEffect(function () {
|
|
4756
4752
|
// Here we set up auto recalculations for the swap details if the form is ready to swap but is idle for some time
|
|
4757
4753
|
var timeoutId = null;
|
|
4758
4754
|
if (readyToSwap) {
|
|
@@ -4772,7 +4768,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4772
4768
|
}, [readyToSwap]);
|
|
4773
4769
|
|
|
4774
4770
|
// TODO: [refactoring, critical] this code looks like a hack related to task_id=6e328d39063142b7b9fa01d497e616da
|
|
4775
|
-
React
|
|
4771
|
+
React.useEffect(function () {
|
|
4776
4772
|
if (triggerDataUpdateResetting) {
|
|
4777
4773
|
clearTimeout(dataUpdateTimeoutId.current);
|
|
4778
4774
|
setDataUpdateTimeoutId(null);
|
|
@@ -4783,18 +4779,18 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4783
4779
|
}, [triggerDataUpdateResetting]);
|
|
4784
4780
|
|
|
4785
4781
|
// Resets the passed "set value to" param to null, so it can be used multiple times with any value
|
|
4786
|
-
React
|
|
4782
|
+
React.useEffect(function () {
|
|
4787
4783
|
if (!!updateSendInputTo) setUpdateSendInputTo(null);
|
|
4788
4784
|
if (!!updateReceiveInputTo) setUpdateReceiveInputTo(null);
|
|
4789
4785
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4790
4786
|
}, [updateSendInputTo, updateReceiveInputTo]);
|
|
4791
|
-
React
|
|
4787
|
+
React.useEffect(function () {
|
|
4792
4788
|
if (swapRate != null && sendAssetAmount.current != null) {
|
|
4793
4789
|
setUpdateReceiveInputTo(AmountUtils.trim(bignumber_js.BigNumber(sendAssetAmount.current).times(swapRate), receivingAssetDecimalCount));
|
|
4794
4790
|
}
|
|
4795
4791
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4796
4792
|
}, [swapRate]);
|
|
4797
|
-
React
|
|
4793
|
+
React.useEffect(function () {
|
|
4798
4794
|
if (isLoading.current === false && swapAllButtonLoaderReSetter != null && swapAllButtonLoaderReSetter.length) {
|
|
4799
4795
|
swapAllButtonLoaderReSetter[0]();
|
|
4800
4796
|
setSwapAllButtonLoaderReSetter([]);
|
|
@@ -4803,7 +4799,7 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4803
4799
|
}, [isLoading.current, swapAllButtonLoaderReSetter]);
|
|
4804
4800
|
|
|
4805
4801
|
// Handlers upon changing the asset amount
|
|
4806
|
-
React
|
|
4802
|
+
React.useEffect(function () {
|
|
4807
4803
|
setConfirmButtonTo(composeConfirmButtonTo(sendingAssetTicker, receivingAssetTicker, sendAssetAmount.current));
|
|
4808
4804
|
if (sendAssetAmount.current == null) return;
|
|
4809
4805
|
var processingAmount = sendAssetAmount.current === "" ? "0" : sendAssetAmount.current;
|
|
@@ -4813,19 +4809,18 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4813
4809
|
setIsSwapCalculated(false);
|
|
4814
4810
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4815
4811
|
}, [sendAssetAmount.current]);
|
|
4816
|
-
return /*#__PURE__*/
|
|
4812
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4817
4813
|
className: s["swap-dialog-form"]
|
|
4818
|
-
}, /*#__PURE__*/
|
|
4814
|
+
}, /*#__PURE__*/React__default["default"].createElement(TitleBox, {
|
|
4819
4815
|
linkButtonClick: bignumber_js.BigNumber(sendingAssetBalance == null ? void 0 : sendingAssetBalance.assetAmount).eq(0) ? null : function (resetButtonLoader) {
|
|
4820
4816
|
return handleSwapAllClick(resetButtonLoader);
|
|
4821
4817
|
},
|
|
4822
4818
|
linkText: !formHasBalance ? "" : isSwapAll.current ? translations.swapAllButtonTitles.cancel : translations.swapAllButtonTitles.enable,
|
|
4823
4819
|
linkButtonLoader: true,
|
|
4824
4820
|
isLinkButtonDisabled: isLoading.current || sendingAssetTicker === receivingAssetTicker || bignumber_js.BigNumber(sendingAssetBalance == null ? void 0 : sendingAssetBalance.assetAmount).eq(0)
|
|
4825
|
-
|
|
4826
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
4821
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4827
4822
|
className: s["swap-dialog-form-inputs"]
|
|
4828
|
-
}, /*#__PURE__*/
|
|
4823
|
+
}, /*#__PURE__*/React__default["default"].createElement(AmountInput, {
|
|
4829
4824
|
ticker: sendingAssetTicker,
|
|
4830
4825
|
tickerPrintable: sendingAssetTickerPrintable,
|
|
4831
4826
|
assetDecimalPlaces: sendingAssetDecimalCount,
|
|
@@ -4853,16 +4848,16 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4853
4848
|
fiatCurrencyDecimals: fiatCurrencyDecimals,
|
|
4854
4849
|
balanceLoaderText: translations.input.balanceLoaderText,
|
|
4855
4850
|
fiatInputPlaceholderText: translations.input.fiatPlaceholder
|
|
4856
|
-
}), /*#__PURE__*/
|
|
4851
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4857
4852
|
className: s["swap-dialog-form-inputs-separator"] + " " + (isLoading.current || sendingAssetTicker === null || receivingAssetTicker === null ? s["disabled"] : "")
|
|
4858
|
-
}, /*#__PURE__*/
|
|
4853
|
+
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
4859
4854
|
src: swapSeparatorIconSrc,
|
|
4860
4855
|
alt: "swap icon",
|
|
4861
4856
|
draggable: false,
|
|
4862
4857
|
onClick: function onClick(e) {
|
|
4863
4858
|
return callHandlingErrors(handleChangeAssetsIconClick, e);
|
|
4864
4859
|
}
|
|
4865
|
-
})), /*#__PURE__*/
|
|
4860
|
+
})), /*#__PURE__*/React__default["default"].createElement(AmountInput, {
|
|
4866
4861
|
ticker: receivingAssetTicker,
|
|
4867
4862
|
tickerPrintable: receivingAssetTickerPrintable,
|
|
4868
4863
|
assetDecimalPlaces: receivingAssetDecimalCount,
|
|
@@ -4886,45 +4881,45 @@ var SwapForm = function SwapForm(_ref) {
|
|
|
4886
4881
|
fiatCurrencyDecimals: fiatCurrencyDecimals,
|
|
4887
4882
|
balanceLoaderText: translations.input.balanceLoaderText,
|
|
4888
4883
|
fiatInputPlaceholderText: translations.input.fiatPlaceholder
|
|
4889
|
-
})), /*#__PURE__*/
|
|
4884
|
+
})), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4890
4885
|
className: s["swap-dialog-form-information-field"]
|
|
4891
|
-
}, /*#__PURE__*/
|
|
4886
|
+
}, /*#__PURE__*/React__default["default"].createElement("p", null, !isPairSupported ? translations.informationBlock.pairNotAvailable : transactionFee && minimalAmountValid ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, translations.informationBlock.transactionFee, /*#__PURE__*/React__default["default"].createElement("span", null, AmountUtils.crypto(transactionFee == null ? void 0 : transactionFee.crypto, sendingAssetFeeCoinTickerPrintable)), (transactionFee == null ? void 0 : transactionFee.fiat) != null && (transactionFee == null ? void 0 : transactionFee.fiat) !== "" ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4892
4887
|
className: s["semi-transparent"]
|
|
4893
|
-
}, " ~ " + AmountUtils.fiat(transactionFee == null ? void 0 : transactionFee.fiat, fiatCurrencyCode)) : "") : isSwapCalculated ? /*#__PURE__*/
|
|
4888
|
+
}, " ~ " + AmountUtils.fiat(transactionFee == null ? void 0 : transactionFee.fiat, fiatCurrencyCode)) : "") : isSwapCalculated ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, translations.informationBlock.swapRate, /*#__PURE__*/React__default["default"].createElement("span", null, AmountUtils.composeRateText(sendingAssetTickerPrintable, receivingAssetTickerPrintable, swapRate))) : minimalAmount.current ? !maximumAmountValid && maximumAmount.current != null ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, translations.informationBlock.maximumAmount, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4894
4889
|
className: s["interactable"] + " " + s["red"],
|
|
4895
4890
|
onClick: isLoading.current ? function () {} : function (e) {
|
|
4896
4891
|
return callHandlingErrors(handleMaximumAmountClick, e);
|
|
4897
4892
|
}
|
|
4898
|
-
}, AmountUtils.crypto((_maximumAmount$curren4 = maximumAmount.current) == null ? void 0 : _maximumAmount$curren4.crypto, sendingAssetTickerPrintable)), ((_maximumAmount$curren5 = maximumAmount.current) == null ? void 0 : _maximumAmount$curren5.fiat) != null && ((_maximumAmount$curren6 = maximumAmount.current) == null ? void 0 : _maximumAmount$curren6.fiat) !== "" ? /*#__PURE__*/
|
|
4893
|
+
}, AmountUtils.crypto((_maximumAmount$curren4 = maximumAmount.current) == null ? void 0 : _maximumAmount$curren4.crypto, sendingAssetTickerPrintable)), ((_maximumAmount$curren5 = maximumAmount.current) == null ? void 0 : _maximumAmount$curren5.fiat) != null && ((_maximumAmount$curren6 = maximumAmount.current) == null ? void 0 : _maximumAmount$curren6.fiat) !== "" ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4899
4894
|
className: s["semi-transparent"]
|
|
4900
|
-
}, " ~ " + AmountUtils.fiat(maximumAmount.current.fiat, fiatCurrencyCode)) : "") : /*#__PURE__*/
|
|
4895
|
+
}, " ~ " + AmountUtils.fiat(maximumAmount.current.fiat, fiatCurrencyCode)) : "") : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, translations.informationBlock.minimumAmount, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4901
4896
|
className: s["interactable"] + " " + (!minimalAmountValid ? s["red"] : ""),
|
|
4902
4897
|
onClick: isLoading.current ? function () {} : function (e) {
|
|
4903
4898
|
return callHandlingErrors(handleMinimalAmountClick, e);
|
|
4904
4899
|
}
|
|
4905
|
-
}, AmountUtils.crypto(minimalAmount.current.crypto, sendingAssetTickerPrintable)), ((_minimalAmount$curren5 = minimalAmount.current) == null ? void 0 : _minimalAmount$curren5.fiat) != null && minimalAmount.current.fiat !== "" ? /*#__PURE__*/
|
|
4900
|
+
}, AmountUtils.crypto(minimalAmount.current.crypto, sendingAssetTickerPrintable)), ((_minimalAmount$curren5 = minimalAmount.current) == null ? void 0 : _minimalAmount$curren5.fiat) != null && minimalAmount.current.fiat !== "" ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4906
4901
|
className: s["semi-transparent"]
|
|
4907
|
-
}, " ~ " + AmountUtils.fiat(minimalAmount.current.fiat, fiatCurrencyCode)) : "") : sendAssetAmount.current || isSwapAll.current ? translations.informationBlock[formHasBalance ? "calculatingNetworkFee" : "calculatingSwapRates"] : translations.informationBlock.loadingMinimalAmount)), validationContent ? /*#__PURE__*/
|
|
4902
|
+
}, " ~ " + AmountUtils.fiat(minimalAmount.current.fiat, fiatCurrencyCode)) : "") : sendAssetAmount.current || isSwapAll.current ? translations.informationBlock[formHasBalance ? "calculatingNetworkFee" : "calculatingSwapRates"] : translations.informationBlock.loadingMinimalAmount)), validationContent ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4908
4903
|
className: s["swap-dialog-form-validation-text"]
|
|
4909
|
-
}, /*#__PURE__*/
|
|
4904
|
+
}, /*#__PURE__*/React__default["default"].createElement(Validation, {
|
|
4910
4905
|
text: validationContent
|
|
4911
|
-
})) : "", /*#__PURE__*/
|
|
4906
|
+
})) : "", /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4912
4907
|
className: s["swap-dialog-form-button-container"]
|
|
4913
|
-
}, formHasBalance ? null : /*#__PURE__*/
|
|
4908
|
+
}, formHasBalance ? null : /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4914
4909
|
className: s["swap-dialog-form-button-container-consent-text"]
|
|
4915
|
-
}, translations.consents.consentTextRate), showConsent ? null : /*#__PURE__*/
|
|
4910
|
+
}, translations.consents.consentTextRate), showConsent ? null : /*#__PURE__*/React__default["default"].createElement("p", {
|
|
4916
4911
|
className: s["swap-dialog-form-button-container-consent-text"]
|
|
4917
|
-
}, translations.consents.consentText + " ", /*#__PURE__*/
|
|
4912
|
+
}, translations.consents.consentText + " ", /*#__PURE__*/React__default["default"].createElement("a", {
|
|
4918
4913
|
// TODO: [dev] fix dox link - pass via property
|
|
4919
4914
|
href: "/docs/legal/swap-terms-of-use.html",
|
|
4920
4915
|
className: s["swap-dialog-form-button-container-consent-text-link"],
|
|
4921
4916
|
target: "_blank"
|
|
4922
|
-
}, translations.consents.termsOfUse), " " + translations.consents.and + " ", /*#__PURE__*/
|
|
4917
|
+
}, translations.consents.termsOfUse), " " + translations.consents.and + " ", /*#__PURE__*/React__default["default"].createElement("a", {
|
|
4923
4918
|
// TODO: [dev] fix dox link - pass via property
|
|
4924
4919
|
href: "/docs/legal/swap-privacy-policy.html",
|
|
4925
4920
|
className: s["swap-dialog-form-button-container-consent-text-link"],
|
|
4926
4921
|
target: "_blank"
|
|
4927
|
-
}, translations.consents.privacyPolicy), "."), /*#__PURE__*/
|
|
4922
|
+
}, translations.consents.privacyPolicy), "."), /*#__PURE__*/React__default["default"].createElement(Button, {
|
|
4928
4923
|
size: "lg",
|
|
4929
4924
|
mode: "primary",
|
|
4930
4925
|
content: translations.confirmButtonText,
|