@rabbitio/ui-kit 1.0.0-beta.83 → 1.0.0-beta.84
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/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +15674 -0
- package/coverage/coverage-final.json +112 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +986 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/rabbit-ui-kit/index.html +116 -0
- package/coverage/rabbit-ui-kit/index.js.html +88 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/googleAnalyticsAdapter.js.html +148 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/analyticsAdapters/mixpanelAdapter.js.html +199 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/axiosAdapter.js.html +190 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common-apis/adapters/qrUtils.js.html +139 -0
- package/coverage/rabbit-ui-kit/src/common-apis/amountUtils.js.html +1162 -0
- package/coverage/rabbit-ui-kit/src/common-apis/errorUtils.js.html +211 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/apiGroups.js.html +250 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common-apis/external-apis/ipAddressProviders.js.html +352 -0
- package/coverage/rabbit-ui-kit/src/common-apis/fiatCurrenciesService.js.html +544 -0
- package/coverage/rabbit-ui-kit/src/common-apis/globalConstants.jsx.html +94 -0
- package/coverage/rabbit-ui-kit/src/common-apis/index.html +161 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/blockchain.js.html +115 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/coin.js.html +544 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/common-apis/models/protocol.js.html +100 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/cache.js.html +811 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/emailAPI.js.html +133 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/index.html +161 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/index.html +131 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logger.js.html +208 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/logging/logsStorage.js.html +268 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/postponeExecution.js.html +118 -0
- package/coverage/rabbit-ui-kit/src/common-apis/utils/safeStringify.js.html +235 -0
- package/coverage/rabbit-ui-kit/src/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/index.js.html +358 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cacheAndConcurrentRequestsResolver.js.html +1570 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cachedRobustExternalApiCallerService.js.html +526 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/cancelProcessing.js.html +172 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/concurrentCalculationsMetadataHolder.js.html +310 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/externalApiProvider.js.html +553 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/externalServicesStatsCollector.js.html +319 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/index.html +206 -0
- package/coverage/rabbit-ui-kit/src/robust-api-caller/robustExternalAPICallerService.js.html +997 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/letsExchangeSwapProvider.js.html +1543 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapProvider.js.html +1705 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/external-apis/swapspaceSwapProvider.js.html +1801 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/baseSwapCreationInfo.js.html +223 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwap.js.html +304 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/existingSwapWithFiatData.js.html +469 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/index.html +176 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/partner.js.html +106 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/models/swapProviderCoinInfo.js.html +193 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/services/publicSwapService.js.html +2161 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/swaps-lib/utils/swapUtils.js.html +670 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowIcon.jsx.html +124 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowTosca.jsx.html +127 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/arrowWhite.jsx.html +127 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/darkRectangle.jsx.html +106 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/determinedError.jsx.html +439 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/failedValidationIcon.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/index.html +281 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/infoIcon.jsx.html +133 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/messageIcon.jsx.html +346 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/noticeQuestionIcon.jsx.html +247 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/successfulValidationIcon.jsx.html +163 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx.html +268 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/assets/wrappedImages/walletIcon.jsx.html +151 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/AssetIcon.jsx.html +256 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetIcon/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/AssetSelection.jsx.html +289 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/AssetSelection/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/BackgroundTitle.jsx.html +187 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/BackgroundTitle/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/InformationMessage.jsx.html +238 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/InformationMessage/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/Input.jsx.html +634 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Input/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/LoadingDots.jsx.html +196 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/LoadingDots/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/NoticeIcon.jsx.html +277 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/NoticeIcon/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/QrCode.jsx.html +217 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/QrCode/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx.html +175 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/RateSelector/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/SupportChat.jsx.html +217 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/SupportChat/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/Textarea.jsx.html +529 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Textarea/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/TitleBox.jsx.html +508 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TitleBox/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/Tooltip.jsx.html +316 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Tooltip/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/LinesOfText.jsx.html +313 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/TwoLinesOfText/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/Validation.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/Validation/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/Button.jsx.html +712 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Button/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/Close.jsx.html +259 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/Close/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/LinkButton.jsx.html +421 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/LinkButton/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/RadioButtonWithText.jsx.html +415 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/atoms/buttons/RadioButtonWithText/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx.html +1087 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/AmountInput/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx.html +1474 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/CoinPicker/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx.html +211 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/ColoredNotice/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LineWithIconLink/LineWithIconLink.jsx.html +190 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LineWithIconLink/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx.html +196 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/LogoCarousel/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx.html +496 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/SearchableCoinsList/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/TitledLineWithIconLink.jsx.html +181 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/molecules/TitledLineWithIconLink/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/CoinPickerDialogStep.jsx.html +283 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/CoinPickerDialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/Dialog.jsx.html +1567 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx.html +481 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx.html +1747 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/Dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx.html +4168 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/SwapForm/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx.html +559 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/organisms/WaitlistSubscription/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/DeterminedErrorDialogStep.jsx.html +316 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/components/templates/DeterminedErrorDialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/index.html +146 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useCallHandlingErrors.js.html +151 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useIsHydrated.js.html +121 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/hooks/useReferredState.js.html +157 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/index.html +161 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/inputValueProviders.js.html +235 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/textUtils.js.html +139 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/uiUtils.js.html +121 -0
- package/coverage/rabbit-ui-kit/src/ui-kit/utils/urlQueryUtils.js.html +271 -0
- package/coverage/rabbit-ui-kit/stories/atoms/BackgroundTitle.stories.jsx.html +202 -0
- package/coverage/rabbit-ui-kit/stories/atoms/LinesOfText.stories.jsx.html +283 -0
- package/coverage/rabbit-ui-kit/stories/atoms/LoadingDots.stories.jsx.html +226 -0
- package/coverage/rabbit-ui-kit/stories/atoms/QrCode.stories.jsx.html +175 -0
- package/coverage/rabbit-ui-kit/stories/atoms/RateSelector.stories.jsx.html +136 -0
- package/coverage/rabbit-ui-kit/stories/atoms/Validation.stories.jsx.html +178 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Button.stories.jsx.html +883 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/Close.stories.jsx.html +211 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/LinkButton.stories.jsx.html +301 -0
- package/coverage/rabbit-ui-kit/stories/atoms/buttons/index.html +146 -0
- package/coverage/rabbit-ui-kit/stories/atoms/index.html +191 -0
- package/coverage/rabbit-ui-kit/stories/molecules/CoinPicker.stories.jsx.html +271 -0
- package/coverage/rabbit-ui-kit/stories/molecules/ColoredNotice.stories.jsx.html +178 -0
- package/coverage/rabbit-ui-kit/stories/molecules/LineWithIconLink.stories.jsx.html +154 -0
- package/coverage/rabbit-ui-kit/stories/molecules/LogoCarousel.stories.jsx.html +160 -0
- package/coverage/rabbit-ui-kit/stories/molecules/TitledLineWithIconLink.stories.jsx.html +160 -0
- package/coverage/rabbit-ui-kit/stories/molecules/index.html +176 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/Dialog.stories.jsx.html +523 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/DialogButtons.stories.jsx.html +328 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogButtons/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/DialogStep.stories.jsx.html +337 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/DialogStep/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/organisms/Dialog/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/organisms/WaitlistSubscription.stories.jsx.html +151 -0
- package/coverage/rabbit-ui-kit/stories/organisms/index.html +116 -0
- package/coverage/rabbit-ui-kit/stories/stubs/coins.jsx.html +6880 -0
- package/coverage/rabbit-ui-kit/stories/stubs/exampleContent.jsx.html +145 -0
- package/coverage/rabbit-ui-kit/stories/stubs/index.html +131 -0
- package/coverage/rabbit-ui-kit/stories/templates/DeterminedErrorDialogStep.stories.jsx.html +190 -0
- package/coverage/rabbit-ui-kit/stories/templates/index.html +116 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/dist/global.css.map +1 -1
- package/dist/index.cjs +1107 -494
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +93 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +926 -418
- package/dist/index.modern.js.map +1 -1
- package/dist/index.module.js +1104 -495
- package/dist/index.module.js.map +1 -1
- package/dist/index.umd.js +1107 -494
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/swaps-lib/external-apis/letsExchangeSwapProvider.js +11 -0
- package/src/swaps-lib/external-apis/swapProvider.js +8 -0
- package/src/swaps-lib/external-apis/swapspaceSwapProvider.js +20 -1
- package/src/swaps-lib/models/partner.js +7 -0
- package/src/swaps-lib/services/publicSwapService.js +17 -0
- package/src/ui-kit/assets/styles/global.scss +4 -7
- package/src/ui-kit/assets/wrappedImages/messageIcon.jsx +87 -0
- package/src/ui-kit/assets/wrappedImages/supportDialogImage.jsx +61 -0
- package/src/ui-kit/components/atoms/RateSelector/RateSelector.jsx +2 -2
- package/src/ui-kit/components/atoms/Validation/Validation.jsx +7 -9
- package/src/ui-kit/components/atoms/Validation/validation.module.scss +4 -0
- package/src/ui-kit/components/molecules/AmountInput/AmountInput.jsx +57 -48
- package/src/ui-kit/components/molecules/AmountInput/amount-input.module.scss +33 -0
- package/src/ui-kit/components/molecules/CoinPicker/CoinPicker.jsx +84 -132
- package/src/ui-kit/components/molecules/ColoredNotice/ColoredNotice.jsx +42 -0
- package/src/ui-kit/components/molecules/ColoredNotice/colored-notice.module.scss +20 -0
- package/src/ui-kit/components/molecules/LogoCarousel/LogoCarousel.jsx +37 -0
- package/src/ui-kit/components/molecules/LogoCarousel/logo-carousel.module.scss +64 -0
- package/src/ui-kit/components/molecules/SearchableCoinsList/SearchableCoinsList.jsx +137 -0
- package/src/ui-kit/components/organisms/Dialog/DialogButtons/DialogButtons.jsx +10 -0
- package/src/ui-kit/components/organisms/Dialog/DialogStep/DialogStep.jsx +16 -0
- package/src/ui-kit/components/organisms/SwapForm/SwapForm.jsx +35 -12
- package/src/ui-kit/components/organisms/WaitlistSubscription/WaitlistSubscription.jsx +158 -0
|
@@ -33,9 +33,11 @@ export const DIALOG_STEP_CLASS = "dialog-step";
|
|
|
33
33
|
* @param {string} props.subtitle - Step subtitle.
|
|
34
34
|
* @param {string} props.backButtonText - Secondary button title.
|
|
35
35
|
* @param {function} props.backButtonClick - Secondary button click handler.
|
|
36
|
+
* @param {boolean} props.backButtonEnabled - Determines whether the secondary button is enabled.
|
|
36
37
|
* @param {string} props.backButtonTo - Secondary button link.
|
|
37
38
|
* @param {string} props.confirmButtonText - Primary button title.
|
|
38
39
|
* @param {function} props.confirmButtonClick - Primary button click handler.
|
|
40
|
+
* @param {boolean} props.confirmButtonEnabled - Determines whether the primary button is enabled.
|
|
39
41
|
* @param {string} props.confirmButtonLink - Primary button link.
|
|
40
42
|
* @param {boolean} props.primaryButtonLoader - Enable loader for the primary button.
|
|
41
43
|
* @param {boolean} props.fixedButtons - Enable fixed buttons in the bottom for mobile devices.
|
|
@@ -72,9 +74,11 @@ export const DialogStep = ({
|
|
|
72
74
|
subtitle = "",
|
|
73
75
|
backButtonText = "",
|
|
74
76
|
backButtonClick = () => {},
|
|
77
|
+
backButtonEnabled = true,
|
|
75
78
|
backButtonTo = "",
|
|
76
79
|
confirmButtonText = "",
|
|
77
80
|
confirmButtonClick = () => {},
|
|
81
|
+
confirmButtonEnabled = true,
|
|
78
82
|
confirmButtonLink = "",
|
|
79
83
|
primaryButtonLoader = false,
|
|
80
84
|
fixedButtons = false,
|
|
@@ -206,11 +210,13 @@ export const DialogStep = ({
|
|
|
206
210
|
{
|
|
207
211
|
primaryButtonTitle: confirmButtonText,
|
|
208
212
|
primaryButtonOnClick: resetButtonLoader => confirmButtonClick(resetButtonLoader),
|
|
213
|
+
primaryButtonEnabled: confirmButtonEnabled,
|
|
209
214
|
primaryButtonLoader: primaryButtonLoader,
|
|
210
215
|
primaryButtonTo: confirmButtonLink,
|
|
211
216
|
primaryButtonSetClickTrigger: setClickTrigger,
|
|
212
217
|
secondaryButtonTitle: backButtonText,
|
|
213
218
|
secondaryButtonOnClick: backButtonClick,
|
|
219
|
+
secondaryButtonEnabled: backButtonEnabled,
|
|
214
220
|
secondaryButtonTo: backButtonTo,
|
|
215
221
|
fixedButtonsEnabled: fixedButtons,
|
|
216
222
|
},
|
|
@@ -243,11 +249,13 @@ export const DialogStep = ({
|
|
|
243
249
|
{
|
|
244
250
|
primaryButtonTitle: confirmButtonText,
|
|
245
251
|
primaryButtonOnClick: resetButtonLoader => confirmButtonClick(resetButtonLoader),
|
|
252
|
+
primaryButtonEnabled: confirmButtonEnabled,
|
|
246
253
|
primaryButtonLoader: primaryButtonLoader,
|
|
247
254
|
primaryButtonTo: confirmButtonLink,
|
|
248
255
|
primaryButtonSetClickTrigger: setClickTrigger,
|
|
249
256
|
secondaryButtonTitle: backButtonText,
|
|
250
257
|
secondaryButtonOnClick: backButtonClick,
|
|
258
|
+
secondaryButtonEnabled: backButtonEnabled,
|
|
251
259
|
secondaryButtonTo: backButtonTo,
|
|
252
260
|
fixedButtonsEnabled: fixedButtons,
|
|
253
261
|
},
|
|
@@ -258,11 +266,13 @@ export const DialogStep = ({
|
|
|
258
266
|
}, [
|
|
259
267
|
confirmButtonText,
|
|
260
268
|
confirmButtonClick,
|
|
269
|
+
confirmButtonEnabled,
|
|
261
270
|
primaryButtonLoader,
|
|
262
271
|
confirmButtonLink,
|
|
263
272
|
setClickTrigger,
|
|
264
273
|
backButtonText,
|
|
265
274
|
backButtonClick,
|
|
275
|
+
backButtonEnabled,
|
|
266
276
|
backButtonTo,
|
|
267
277
|
currentStep,
|
|
268
278
|
]);
|
|
@@ -441,11 +451,13 @@ export const DialogStep = ({
|
|
|
441
451
|
<DialogButtons
|
|
442
452
|
primaryButtonTitle={confirmButtonText}
|
|
443
453
|
primaryButtonOnClick={resetButtonLoader => confirmButtonClick(resetButtonLoader)}
|
|
454
|
+
primaryButtonEnabled={confirmButtonEnabled}
|
|
444
455
|
primaryButtonLoader={primaryButtonLoader}
|
|
445
456
|
primaryButtonTo={confirmButtonLink}
|
|
446
457
|
primaryButtonSetClickTrigger={setClickTrigger}
|
|
447
458
|
secondaryButtonTitle={backButtonText}
|
|
448
459
|
secondaryButtonOnClick={backButtonClick}
|
|
460
|
+
secondaryButtonEnabled={backButtonEnabled}
|
|
449
461
|
secondaryButtonTo={backButtonTo}
|
|
450
462
|
secondaryButtonBig={isSecondaryButtonBig}
|
|
451
463
|
withBackgroundImage={!!backgroundImage || !!backgroundImageMobile}
|
|
@@ -475,9 +487,11 @@ DialogStep.propTypes = {
|
|
|
475
487
|
subtitle: PropTypes.string,
|
|
476
488
|
backButtonText: PropTypes.string,
|
|
477
489
|
backButtonClick: PropTypes.func,
|
|
490
|
+
backButtonEnabled: PropTypes.bool,
|
|
478
491
|
backButtonTo: PropTypes.string,
|
|
479
492
|
confirmButtonText: PropTypes.string,
|
|
480
493
|
confirmButtonClick: PropTypes.func,
|
|
494
|
+
confirmButtonEnabled: PropTypes.bool,
|
|
481
495
|
confirmButtonLink: PropTypes.string,
|
|
482
496
|
primaryButtonLoader: PropTypes.bool,
|
|
483
497
|
fixedButtons: PropTypes.bool,
|
|
@@ -512,9 +526,11 @@ DialogStep.defaultProps = {
|
|
|
512
526
|
subtitle: "",
|
|
513
527
|
backButtonText: "",
|
|
514
528
|
backButtonClick: () => {},
|
|
529
|
+
backButtonEnabled: true,
|
|
515
530
|
backButtonTo: "",
|
|
516
531
|
confirmButtonText: "",
|
|
517
532
|
confirmButtonClick: () => {},
|
|
533
|
+
confirmButtonEnabled: true,
|
|
518
534
|
confirmButtonLink: "",
|
|
519
535
|
primaryButtonLoader: false,
|
|
520
536
|
fixedButtons: false,
|
|
@@ -480,7 +480,7 @@ export const SwapForm = ({
|
|
|
480
480
|
);
|
|
481
481
|
};
|
|
482
482
|
|
|
483
|
-
const requestDataRefresh = (amount, immediately = false, isSwapAll = false) => {
|
|
483
|
+
const requestDataRefresh = (amount, immediately = false, isSwapAll = false, ignoreEmptyAmount = false) => {
|
|
484
484
|
try {
|
|
485
485
|
clearTimeout(dataUpdateTimeoutId.current);
|
|
486
486
|
|
|
@@ -489,11 +489,11 @@ export const SwapForm = ({
|
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
-
if (!amount) {
|
|
492
|
+
if (!amount && !ignoreEmptyAmount) {
|
|
493
493
|
return;
|
|
494
494
|
}
|
|
495
495
|
|
|
496
|
-
if (BigNumber(amount).eq("0")) {
|
|
496
|
+
if (BigNumber(amount).eq("0") || amount == null || amount === "") {
|
|
497
497
|
if (immediately) {
|
|
498
498
|
loadMinimalAmountAndSwapRate(true);
|
|
499
499
|
} else {
|
|
@@ -663,7 +663,12 @@ export const SwapForm = ({
|
|
|
663
663
|
|
|
664
664
|
const swapData = await retrieveInitialSwapData(sendingAssetTicker, receivingAssetTicker);
|
|
665
665
|
|
|
666
|
-
if (
|
|
666
|
+
if (
|
|
667
|
+
(isFixedRate.current && isLastEditedReceiving.current
|
|
668
|
+
? receiveAssetAmount.current != null
|
|
669
|
+
: sendAssetAmount.current != null) &&
|
|
670
|
+
!isCalledForClearedInput
|
|
671
|
+
) {
|
|
667
672
|
// Means user already entered amount after starting the form initialization
|
|
668
673
|
return;
|
|
669
674
|
}
|
|
@@ -720,7 +725,12 @@ export const SwapForm = ({
|
|
|
720
725
|
|
|
721
726
|
const handleRateModeChanged = isFixed => {
|
|
722
727
|
setIsFixedRate(isFixed);
|
|
723
|
-
requestDataRefresh(
|
|
728
|
+
requestDataRefresh(
|
|
729
|
+
isLastEditedReceiving.current ? receiveAssetAmount.current : sendAssetAmount.current,
|
|
730
|
+
true,
|
|
731
|
+
null,
|
|
732
|
+
true
|
|
733
|
+
);
|
|
724
734
|
};
|
|
725
735
|
|
|
726
736
|
useEffect(() => {
|
|
@@ -741,9 +751,11 @@ export const SwapForm = ({
|
|
|
741
751
|
useEffect(() => {
|
|
742
752
|
if (!sendingAssetTicker || !receivingAssetTicker) return;
|
|
743
753
|
|
|
744
|
-
const
|
|
754
|
+
const currentAmount = isLastEditedReceiving.current ? receiveAssetAmount.current : sendAssetAmount.current;
|
|
755
|
+
|
|
756
|
+
const isCurrentAmountNotZero = currentAmount && !BigNumber("0").eq(currentAmount);
|
|
745
757
|
if (isCurrentAmountNotZero) {
|
|
746
|
-
loadFullEstimation(
|
|
758
|
+
loadFullEstimation(currentAmount);
|
|
747
759
|
} else {
|
|
748
760
|
loadMinimalAmountAndSwapRate(true);
|
|
749
761
|
}
|
|
@@ -868,7 +880,10 @@ export const SwapForm = ({
|
|
|
868
880
|
}, [updateSendInputTo, updateReceiveInputTo]);
|
|
869
881
|
|
|
870
882
|
useEffect(() => {
|
|
871
|
-
if (
|
|
883
|
+
if (
|
|
884
|
+
swapRate != null &&
|
|
885
|
+
(isLastEditedReceiving.current ? receiveAssetAmount.current : sendAssetAmount.current) != null
|
|
886
|
+
) {
|
|
872
887
|
if (isLastEditedReceiving.current) {
|
|
873
888
|
setUpdateSendInputTo(
|
|
874
889
|
AmountUtils.trim(BigNumber(receiveAssetAmount.current).div(swapRate), sendingAssetDecimalCount)
|
|
@@ -969,7 +984,11 @@ export const SwapForm = ({
|
|
|
969
984
|
ref={fromAssetSelectionButtonRef}
|
|
970
985
|
isLoading={isLastEditedReceiving.current ? isLoading.current : false}
|
|
971
986
|
cryptoAssetToFiatRate={sendingAssetToFiatRate}
|
|
972
|
-
fiatCurrencyCode={
|
|
987
|
+
fiatCurrencyCode={
|
|
988
|
+
formHasFiat && (isLoading.current || sendingAssetToFiatRate != null)
|
|
989
|
+
? fiatCurrencyCode
|
|
990
|
+
: null
|
|
991
|
+
}
|
|
973
992
|
fiatCurrencyDecimals={fiatCurrencyDecimals}
|
|
974
993
|
balanceLoaderText={translations.input.balanceLoaderText}
|
|
975
994
|
fiatInputPlaceholderText={translations.input.fiatPlaceholder}
|
|
@@ -1000,7 +1019,7 @@ export const SwapForm = ({
|
|
|
1000
1019
|
assetIconProtocolSrc={receivingAssetProtocolIconSrc}
|
|
1001
1020
|
fallbackAssetIconSrc={fallBackAssetIconSrc}
|
|
1002
1021
|
disabled={isSwapAll.current || sendingAssetTicker === null || receivingAssetTicker === null}
|
|
1003
|
-
locked={!formHasBalance
|
|
1022
|
+
locked={!formHasBalance}
|
|
1004
1023
|
handleCoinAmountChange={handleReceiveAssetAmountChange}
|
|
1005
1024
|
handleChangeAssetClick={handleChangeReceivingAssetClick}
|
|
1006
1025
|
updateAssetInputTo={updateReceiveInputTo}
|
|
@@ -1013,7 +1032,11 @@ export const SwapForm = ({
|
|
|
1013
1032
|
ref={toAssetSelectionButtonRef}
|
|
1014
1033
|
isLoading={isLastEditedReceiving.current ? false : isLoading.current}
|
|
1015
1034
|
cryptoAssetToFiatRate={receivingAssetToFiatRate}
|
|
1016
|
-
fiatCurrencyCode={
|
|
1035
|
+
fiatCurrencyCode={
|
|
1036
|
+
formHasFiat && (isLoading.current || receivingAssetToFiatRate != null)
|
|
1037
|
+
? fiatCurrencyCode
|
|
1038
|
+
: null
|
|
1039
|
+
}
|
|
1017
1040
|
fiatCurrencyDecimals={fiatCurrencyDecimals}
|
|
1018
1041
|
balanceLoaderText={translations.input.balanceLoaderText}
|
|
1019
1042
|
fiatInputPlaceholderText={translations.input.fiatPlaceholder}
|
|
@@ -1108,7 +1131,7 @@ export const SwapForm = ({
|
|
|
1108
1131
|
</>
|
|
1109
1132
|
)
|
|
1110
1133
|
) : isLoading.current ? (
|
|
1111
|
-
sendAssetAmount.current || isSwapAll.current ? (
|
|
1134
|
+
sendAssetAmount.current || receiveAssetAmount.current || isSwapAll.current ? (
|
|
1112
1135
|
translations.informationBlock[
|
|
1113
1136
|
formHasBalance ? "calculatingNetworkFee" : "calculatingSwapRates"
|
|
1114
1137
|
]
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import { logErrorOrOutputToConsole } from "../../../../common-apis/errorUtils";
|
|
5
|
+
import { Coin } from "../../../../common-apis/models/coin";
|
|
6
|
+
|
|
7
|
+
import { ColoredNotice } from "../../molecules/ColoredNotice/ColoredNotice";
|
|
8
|
+
import { Dialog } from "../Dialog/Dialog";
|
|
9
|
+
import { DialogStep } from "../Dialog/DialogStep/DialogStep";
|
|
10
|
+
import { Input } from "../../atoms/Input/Input";
|
|
11
|
+
import { TitleBox } from "../../atoms/TitleBox/TitleBox";
|
|
12
|
+
import { Validation } from "../../atoms/Validation/Validation";
|
|
13
|
+
|
|
14
|
+
import messageIcon from "../../../assets/wrappedImages/messageIcon";
|
|
15
|
+
import supportDialogImage from "../../../assets/wrappedImages/supportDialogImage";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Saves a user's subscription to receive notifications about a specific coin.
|
|
19
|
+
* This function sends an email to subscribe the user to notifications for the specified coin.
|
|
20
|
+
*
|
|
21
|
+
* @function
|
|
22
|
+
* @name saveSubscription
|
|
23
|
+
* @param {Coin} coin - The coin object containing information about the coin, including its ticker symbol.
|
|
24
|
+
* @param {string} address - The email address of the user who wishes to subscribe.
|
|
25
|
+
* @returns {Promise<boolean>} A promise that resolves to `true` if the subscription email was sent successfully, or `false` if an error occurred during the process.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* WaitlistSubscription component handles user subscription to a waitlist for coin notifications.
|
|
30
|
+
* It displays a notice with a button to open a dialog where the user can enter their email to subscribe.
|
|
31
|
+
*
|
|
32
|
+
* @component
|
|
33
|
+
* @param {Object} props - The component props.
|
|
34
|
+
* @param {Coin} props.coin - The coin object containing information about the coin.
|
|
35
|
+
* @param {Object} props.translations - The text translations for the component.
|
|
36
|
+
* @param {saveSubscription} props.saveSubscription - Function to handle/save the subscription.
|
|
37
|
+
* @returns {JSX.Element} The WaitlistSubscription component.
|
|
38
|
+
*/
|
|
39
|
+
export const WaitlistSubscription = ({ coin, translations, saveSubscription }) => {
|
|
40
|
+
const [controls, initControls] = useState();
|
|
41
|
+
const [showDialog, setShowDialog] = useState(false);
|
|
42
|
+
const [inputValue, setInputValue] = useState("");
|
|
43
|
+
const [isEmailValid, setIsEmailValid] = useState(false);
|
|
44
|
+
const [errorEncountered, setErrorEncountered] = useState(false);
|
|
45
|
+
|
|
46
|
+
const defaultTranslations = {
|
|
47
|
+
coloredNotice: {
|
|
48
|
+
text: "This is a pre-listed coin, meaning that the swap is not yet available. As soon as this coin allows exchanges, it will be automatically enabled. If you want to get a notification as soon as this coin becomes available for swap - sign up for the waitlist below!",
|
|
49
|
+
buttonTitle: "Subscribe for updates",
|
|
50
|
+
},
|
|
51
|
+
signUpStep: {
|
|
52
|
+
title: coin.latinName + " (" + coin.ticker + ") listing notification",
|
|
53
|
+
subtitle:
|
|
54
|
+
"To be notified as soon as " +
|
|
55
|
+
coin.latinName +
|
|
56
|
+
" becomes available for swaps, please provide your email address. We’ll send you a single notification when it’s listed.",
|
|
57
|
+
actionButtonTitle: "Subscribe",
|
|
58
|
+
inputTitle: "Your email address:",
|
|
59
|
+
error: "Something went wrong. Please try again later.",
|
|
60
|
+
},
|
|
61
|
+
successStep: {
|
|
62
|
+
title: "Subscribed successfully!",
|
|
63
|
+
subtitle:
|
|
64
|
+
"We’ll notify you as soon as " +
|
|
65
|
+
coin.latinName +
|
|
66
|
+
" becomes available for swaps. Keep an eye on your inbox for the update.",
|
|
67
|
+
actionButtonTitle: "Close",
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const t = translations ?? defaultTranslations;
|
|
72
|
+
|
|
73
|
+
const STEPS = {
|
|
74
|
+
signUp: "signUp",
|
|
75
|
+
success: "success",
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const subscribe = async resetButtonLoader => {
|
|
79
|
+
try {
|
|
80
|
+
setErrorEncountered(false);
|
|
81
|
+
const result = await saveSubscription(coin, inputValue);
|
|
82
|
+
if (result) {
|
|
83
|
+
controls?.goToStep(STEPS.success);
|
|
84
|
+
} else {
|
|
85
|
+
setErrorEncountered(true);
|
|
86
|
+
}
|
|
87
|
+
resetButtonLoader();
|
|
88
|
+
} catch (e) {
|
|
89
|
+
resetButtonLoader();
|
|
90
|
+
logErrorOrOutputToConsole(e);
|
|
91
|
+
setShowDialog(false);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const openDialog = () => {
|
|
96
|
+
setErrorEncountered(false);
|
|
97
|
+
setInputValue("");
|
|
98
|
+
setIsEmailValid(false);
|
|
99
|
+
controls?.toFirstStep(false);
|
|
100
|
+
setShowDialog(true);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
setIsEmailValid(/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(inputValue));
|
|
105
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
106
|
+
}, [inputValue]);
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<>
|
|
110
|
+
<Dialog
|
|
111
|
+
initControls={controls => initControls(controls)}
|
|
112
|
+
showDialog={showDialog}
|
|
113
|
+
onClose={() => setShowDialog(false)}
|
|
114
|
+
>
|
|
115
|
+
<DialogStep
|
|
116
|
+
stepName={STEPS.signUp}
|
|
117
|
+
controls={controls}
|
|
118
|
+
title={t.signUpStep.title}
|
|
119
|
+
subtitle={t.signUpStep.subtitle}
|
|
120
|
+
confirmButtonClick={subscribe}
|
|
121
|
+
confirmButtonEnabled={isEmailValid}
|
|
122
|
+
confirmButtonText={t.signUpStep.actionButtonTitle}
|
|
123
|
+
primaryButtonLoader={true}
|
|
124
|
+
subtitleSmallMargin
|
|
125
|
+
showBackgroundTitle={false}
|
|
126
|
+
ImageRaw={messageIcon}
|
|
127
|
+
>
|
|
128
|
+
<TitleBox title={t.signUpStep.inputTitle}>
|
|
129
|
+
<Input type="text" onChange={e => setInputValue(e.target.value)} value={inputValue} />
|
|
130
|
+
{errorEncountered ? <Validation text={t.signUpStep.error} /> : null}
|
|
131
|
+
</TitleBox>
|
|
132
|
+
</DialogStep>
|
|
133
|
+
<DialogStep
|
|
134
|
+
stepName={STEPS.success}
|
|
135
|
+
controls={controls}
|
|
136
|
+
title={t.successStep.title}
|
|
137
|
+
subtitle={t.successStep.subtitle}
|
|
138
|
+
confirmButtonClick={() => setShowDialog(false)}
|
|
139
|
+
confirmButtonText={t.successStep.actionButtonTitle}
|
|
140
|
+
showBackgroundTitle={false}
|
|
141
|
+
ImageRaw={supportDialogImage}
|
|
142
|
+
showCornerBackButton={false}
|
|
143
|
+
subtitleSmallMargin
|
|
144
|
+
/>
|
|
145
|
+
</Dialog>
|
|
146
|
+
<ColoredNotice
|
|
147
|
+
text={t.coloredNotice.text}
|
|
148
|
+
buttonTitle={t.coloredNotice.buttonTitle}
|
|
149
|
+
onButtonClick={openDialog}
|
|
150
|
+
/>
|
|
151
|
+
</>
|
|
152
|
+
);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
WaitlistSubscription.propTypes = {
|
|
156
|
+
coin: PropTypes.object.isRequired,
|
|
157
|
+
translations: PropTypes.object,
|
|
158
|
+
};
|