@stokr/components-library 2.3.42 → 2.3.44-beta.1
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/README.md +1 -1
- package/dist/components/BarChart/BarChart.js +2 -2
- package/dist/components/Button/GlareButton.js +42 -25
- package/dist/components/Button/GlareButton.stories.js +10 -5
- package/dist/components/Checklist/ChecklistCard.js +105 -0
- package/dist/components/Checklist/ChecklistCard.stories.js +125 -0
- package/dist/components/Checklist/ChecklistCard.styles.js +36 -0
- package/dist/components/Footer/FooterMenu.stories.js +3 -3
- package/dist/components/Footer/mangopay.svg +20 -20
- package/dist/components/Form/Form.js +7 -7
- package/dist/components/MatomoConnect/Matomo.js +24 -24
- package/dist/components/MatomoConnect/Matomo_fuckup.js +24 -24
- package/dist/components/Pagination/usePagination.js +17 -17
- package/dist/components/RegisterAlgorand/AlgoAddressName.js +138 -0
- package/dist/components/RegisterAlgorand/AlgoAdressSelect.js +443 -0
- package/dist/components/RegisterAlgorand/AlgoConnectWallet.js +47 -0
- package/dist/components/RegisterAlgorand/AlgoSuccess.js +38 -0
- package/dist/components/RegisterAlgorand/Algorand.stories.js +80 -0
- package/dist/components/RegisterAlgorand/ChooseWallet.js +97 -0
- package/dist/components/RegisterAlgorand/SelectProject.js +89 -0
- package/dist/components/RegisterAlgorand/_styles.js +28 -0
- package/dist/components/RegisterAlgorand/flow.js +409 -0
- package/dist/components/RegisterAlgorand/flowWithMemo.js +410 -0
- package/dist/components/RegisterAlgorand/index.js +48 -0
- package/dist/components/RegisterEthereum/EthAddressLedger.js +226 -0
- package/dist/components/RegisterEthereum/EthAddressMetamask.js +204 -0
- package/dist/components/RegisterEthereum/EthAddressName.js +135 -0
- package/dist/components/RegisterEthereum/EthConnectLedger.js +194 -0
- package/dist/components/RegisterEthereum/EthConnectMetamask.js +35 -0
- package/dist/components/RegisterEthereum/EthFinish.js +41 -0
- package/dist/components/RegisterEthereum/EthIntro.js +95 -0
- package/dist/components/RegisterEthereum/_styles.js +28 -0
- package/dist/components/RegisterEthereum/index.js +68 -0
- package/dist/components/{ResendConfirmationCodeModal/ResendConfirmationCodeModal.js → RiskQuestionnaire/RiskQuestionnaireContext.js} +161 -199
- package/dist/components/RiskQuestionnaire/_styles.js +15 -0
- package/dist/components/SigningSubflow/SignSubAddressMetamask.js +137 -0
- package/dist/components/SigningSubflow/SignSubConnectLedger.js +150 -0
- package/dist/components/SigningSubflow/SignSubConnectMetamask.js +137 -0
- package/dist/components/SigningSubflow/SignSubSendLedger.js +150 -0
- package/dist/components/SigningSubflow/SignSubSendMetamask.js +62 -0
- package/dist/components/SigningSubflow/SignSubTransactionLedger.js +161 -0
- package/dist/components/SigningSubflow/SignSubTransactionMetamask.js +166 -0
- package/dist/components/icons/LinkIcon.js +2 -2
- package/dist/context/Auth.js +6 -6
- package/dist/index.js +11 -0
- package/dist/static/country-list.json +251 -251
- package/dist/static/fonts/Ionicons/ionicons.min.css +12 -12
- package/dist/static/fonts/icomoon/icomoon.eot +0 -0
- package/dist/static/fonts/icomoon/icomoon.svg +52 -52
- package/dist/static/fonts/icomoon/icomoon.ttf +0 -0
- package/dist/static/fonts/icomoon/icomoon.woff +0 -0
- package/dist/static/fonts/icomoon/selection.json +0 -0
- package/dist/static/fonts/icomoon/style.css +137 -137
- package/dist/static/images/Glassess.svg +5 -5
- package/dist/static/images/arrow-down-black.svg +21 -21
- package/dist/static/images/favicon.svg +57 -57
- package/dist/static/images/mangopay.svg +20 -20
- package/dist/static/images/nav_green.svg +30 -30
- package/dist/static/images/prof-inv.svg +3 -3
- package/dist/static/images/two-sided-document.svg +26 -26
- package/dist/static/images/warning-filled.svg +3 -0
- package/dist/utils/allowed-countries-list.js +448 -448
- package/dist/utils/scrollUtils.js +59 -0
- package/package.json +142 -142
- package/dist/components/RegisterLiquidSteps/assets/nav_green.svg +0 -31
- package/dist/components/RegisterLiquidSteps/assets/videothumbnail.jpg +0 -0
- package/dist/components/ResendConfirmationCodeModal/ResendConfirmationCodeModal.stories.js +0 -48
- package/dist/components/StokrLoader/stokr_loader_white_400x400.gif +0 -0
- package/dist/components/SvgIcons/Icons_Badge.png +0 -0
- package/dist/components/video/img/play-btn.svg +0 -1
|
@@ -116,9 +116,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
116
116
|
}, {
|
|
117
117
|
key: "LiveGetCounters",
|
|
118
118
|
value:
|
|
119
|
-
/**
|
|
120
|
-
* Get real time counters
|
|
121
|
-
* @param lastMinutes
|
|
119
|
+
/**
|
|
120
|
+
* Get real time counters
|
|
121
|
+
* @param lastMinutes
|
|
122
122
|
*/
|
|
123
123
|
function () {
|
|
124
124
|
var _LiveGetCounters = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(lastMinutes, column) {
|
|
@@ -160,9 +160,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
160
160
|
}
|
|
161
161
|
return LiveGetCounters;
|
|
162
162
|
}()
|
|
163
|
-
/**
|
|
164
|
-
* Get visits summary for date range
|
|
165
|
-
* @param range
|
|
163
|
+
/**
|
|
164
|
+
* Get visits summary for date range
|
|
165
|
+
* @param range
|
|
166
166
|
*/
|
|
167
167
|
}, {
|
|
168
168
|
key: "GetVisitsSummary",
|
|
@@ -206,9 +206,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
206
206
|
}
|
|
207
207
|
return GetVisitsSummary;
|
|
208
208
|
}()
|
|
209
|
-
/**
|
|
210
|
-
* Get summary per country
|
|
211
|
-
* @param range
|
|
209
|
+
/**
|
|
210
|
+
* Get summary per country
|
|
211
|
+
* @param range
|
|
212
212
|
*/
|
|
213
213
|
}, {
|
|
214
214
|
key: "GetCountrySummary",
|
|
@@ -252,9 +252,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
252
252
|
}
|
|
253
253
|
return GetCountrySummary;
|
|
254
254
|
}()
|
|
255
|
-
/**
|
|
256
|
-
* Get summary for social networks
|
|
257
|
-
* @param range
|
|
255
|
+
/**
|
|
256
|
+
* Get summary for social networks
|
|
257
|
+
* @param range
|
|
258
258
|
*/
|
|
259
259
|
}, {
|
|
260
260
|
key: "GetSocialSummary",
|
|
@@ -298,9 +298,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
298
298
|
}
|
|
299
299
|
return GetSocialSummary;
|
|
300
300
|
}()
|
|
301
|
-
/**
|
|
302
|
-
* Get summary for os families
|
|
303
|
-
* @param range
|
|
301
|
+
/**
|
|
302
|
+
* Get summary for os families
|
|
303
|
+
* @param range
|
|
304
304
|
*/
|
|
305
305
|
}, {
|
|
306
306
|
key: "GetDeviceOsFamilies",
|
|
@@ -344,9 +344,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
344
344
|
}
|
|
345
345
|
return GetDeviceOsFamilies;
|
|
346
346
|
}()
|
|
347
|
-
/**
|
|
348
|
-
* Get summary for browsers
|
|
349
|
-
* @param range
|
|
347
|
+
/**
|
|
348
|
+
* Get summary for browsers
|
|
349
|
+
* @param range
|
|
350
350
|
*/
|
|
351
351
|
}, {
|
|
352
352
|
key: "GetDeviceBrowsers",
|
|
@@ -390,9 +390,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
390
390
|
}
|
|
391
391
|
return GetDeviceBrowsers;
|
|
392
392
|
}()
|
|
393
|
-
/**
|
|
394
|
-
* Get summary for browsers
|
|
395
|
-
* @param range
|
|
393
|
+
/**
|
|
394
|
+
* Get summary for browsers
|
|
395
|
+
* @param range
|
|
396
396
|
*/
|
|
397
397
|
}, {
|
|
398
398
|
key: "GetDeviceModels",
|
|
@@ -436,9 +436,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
436
436
|
}
|
|
437
437
|
return GetDeviceModels;
|
|
438
438
|
}()
|
|
439
|
-
/**
|
|
440
|
-
* Get visit times per local time
|
|
441
|
-
* @param range
|
|
439
|
+
/**
|
|
440
|
+
* Get visit times per local time
|
|
441
|
+
* @param range
|
|
442
442
|
*/
|
|
443
443
|
}, {
|
|
444
444
|
key: "GetVisitTimePerLocalTime",
|
|
@@ -38,9 +38,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
38
38
|
_createClass(Matomo, [{
|
|
39
39
|
key: "LiveGetCounters",
|
|
40
40
|
value:
|
|
41
|
-
/**
|
|
42
|
-
* Get real time counters
|
|
43
|
-
* @param lastMinutes
|
|
41
|
+
/**
|
|
42
|
+
* Get real time counters
|
|
43
|
+
* @param lastMinutes
|
|
44
44
|
*/
|
|
45
45
|
function () {
|
|
46
46
|
var _LiveGetCounters = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(lastMinutes, column) {
|
|
@@ -79,9 +79,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
79
79
|
}
|
|
80
80
|
return LiveGetCounters;
|
|
81
81
|
}()
|
|
82
|
-
/**
|
|
83
|
-
* Get visits summary for date range
|
|
84
|
-
* @param range
|
|
82
|
+
/**
|
|
83
|
+
* Get visits summary for date range
|
|
84
|
+
* @param range
|
|
85
85
|
*/
|
|
86
86
|
}, {
|
|
87
87
|
key: "GetVisitsSummary",
|
|
@@ -122,9 +122,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
122
122
|
}
|
|
123
123
|
return GetVisitsSummary;
|
|
124
124
|
}()
|
|
125
|
-
/**
|
|
126
|
-
* Get summary per country
|
|
127
|
-
* @param range
|
|
125
|
+
/**
|
|
126
|
+
* Get summary per country
|
|
127
|
+
* @param range
|
|
128
128
|
*/
|
|
129
129
|
}, {
|
|
130
130
|
key: "GetCountrySummary",
|
|
@@ -165,9 +165,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
165
165
|
}
|
|
166
166
|
return GetCountrySummary;
|
|
167
167
|
}()
|
|
168
|
-
/**
|
|
169
|
-
* Get summary for social networks
|
|
170
|
-
* @param range
|
|
168
|
+
/**
|
|
169
|
+
* Get summary for social networks
|
|
170
|
+
* @param range
|
|
171
171
|
*/
|
|
172
172
|
}, {
|
|
173
173
|
key: "GetSocialSummary",
|
|
@@ -208,9 +208,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
208
208
|
}
|
|
209
209
|
return GetSocialSummary;
|
|
210
210
|
}()
|
|
211
|
-
/**
|
|
212
|
-
* Get summary for os families
|
|
213
|
-
* @param range
|
|
211
|
+
/**
|
|
212
|
+
* Get summary for os families
|
|
213
|
+
* @param range
|
|
214
214
|
*/
|
|
215
215
|
}, {
|
|
216
216
|
key: "GetDeviceOsFamilies",
|
|
@@ -251,9 +251,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
251
251
|
}
|
|
252
252
|
return GetDeviceOsFamilies;
|
|
253
253
|
}()
|
|
254
|
-
/**
|
|
255
|
-
* Get summary for browsers
|
|
256
|
-
* @param range
|
|
254
|
+
/**
|
|
255
|
+
* Get summary for browsers
|
|
256
|
+
* @param range
|
|
257
257
|
*/
|
|
258
258
|
}, {
|
|
259
259
|
key: "GetDeviceBrowsers",
|
|
@@ -294,9 +294,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
294
294
|
}
|
|
295
295
|
return GetDeviceBrowsers;
|
|
296
296
|
}()
|
|
297
|
-
/**
|
|
298
|
-
* Get summary for browsers
|
|
299
|
-
* @param range
|
|
297
|
+
/**
|
|
298
|
+
* Get summary for browsers
|
|
299
|
+
* @param range
|
|
300
300
|
*/
|
|
301
301
|
}, {
|
|
302
302
|
key: "GetDeviceModels",
|
|
@@ -337,9 +337,9 @@ var Matomo = /*#__PURE__*/function () {
|
|
|
337
337
|
}
|
|
338
338
|
return GetDeviceModels;
|
|
339
339
|
}()
|
|
340
|
-
/**
|
|
341
|
-
* Get visit times per local time
|
|
342
|
-
* @param range
|
|
340
|
+
/**
|
|
341
|
+
* Get visit times per local time
|
|
342
|
+
* @param range
|
|
343
343
|
*/
|
|
344
344
|
}, {
|
|
345
345
|
key: "GetVisitTimePerLocalTime",
|
|
@@ -15,9 +15,9 @@ var DOTS = '...';
|
|
|
15
15
|
exports.DOTS = DOTS;
|
|
16
16
|
var range = function range(start, end) {
|
|
17
17
|
var length = end - start + 1;
|
|
18
|
-
/*
|
|
19
|
-
Create an array of certain length and set the elements within it from
|
|
20
|
-
start value to end value.
|
|
18
|
+
/*
|
|
19
|
+
Create an array of certain length and set the elements within it from
|
|
20
|
+
start value to end value.
|
|
21
21
|
*/
|
|
22
22
|
return Array.from({
|
|
23
23
|
length: length
|
|
@@ -38,31 +38,31 @@ var usePagination = function usePagination(_ref) {
|
|
|
38
38
|
// Pages count is determined as siblingCount + firstPage + lastPage + currentPage + 2*DOTS
|
|
39
39
|
var totalPageNumbers = siblingCount + 5;
|
|
40
40
|
|
|
41
|
-
/*
|
|
42
|
-
Case 1:
|
|
43
|
-
If the number of pages is less than the page numbers we want to show in our
|
|
44
|
-
paginationComponent, we return the range [1..totalPageCount]
|
|
41
|
+
/*
|
|
42
|
+
Case 1:
|
|
43
|
+
If the number of pages is less than the page numbers we want to show in our
|
|
44
|
+
paginationComponent, we return the range [1..totalPageCount]
|
|
45
45
|
*/
|
|
46
46
|
if (totalPageNumbers >= totalPageCount) {
|
|
47
47
|
return range(1, totalPageCount);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
/*
|
|
51
|
-
Calculate left and right sibling index and make sure they are within range 1 and totalPageCount
|
|
50
|
+
/*
|
|
51
|
+
Calculate left and right sibling index and make sure they are within range 1 and totalPageCount
|
|
52
52
|
*/
|
|
53
53
|
var leftSiblingIndex = Math.max(currentPage - siblingCount, 1);
|
|
54
54
|
var rightSiblingIndex = Math.min(currentPage + siblingCount, totalPageCount);
|
|
55
55
|
|
|
56
|
-
/*
|
|
57
|
-
We do not show dots just when there is just one page number to be inserted between the extremes of sibling and the page limits i.e 1 and totalPageCount. Hence we are using leftSiblingIndex > 2 and rightSiblingIndex < totalPageCount - 2
|
|
56
|
+
/*
|
|
57
|
+
We do not show dots just when there is just one page number to be inserted between the extremes of sibling and the page limits i.e 1 and totalPageCount. Hence we are using leftSiblingIndex > 2 and rightSiblingIndex < totalPageCount - 2
|
|
58
58
|
*/
|
|
59
59
|
var shouldShowLeftDots = leftSiblingIndex > 2;
|
|
60
60
|
var shouldShowRightDots = rightSiblingIndex < totalPageCount - 2;
|
|
61
61
|
var firstPageIndex = 1;
|
|
62
62
|
var lastPageIndex = totalPageCount;
|
|
63
63
|
|
|
64
|
-
/*
|
|
65
|
-
Case 2: No left dots to show, but rights dots to be shown
|
|
64
|
+
/*
|
|
65
|
+
Case 2: No left dots to show, but rights dots to be shown
|
|
66
66
|
*/
|
|
67
67
|
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
68
68
|
var leftItemCount = 3 + 2 * siblingCount;
|
|
@@ -70,8 +70,8 @@ var usePagination = function usePagination(_ref) {
|
|
|
70
70
|
return [].concat(_toConsumableArray(leftRange), [DOTS, totalPageCount]);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
/*
|
|
74
|
-
Case 3: No right dots to show, but left dots to be shown
|
|
73
|
+
/*
|
|
74
|
+
Case 3: No right dots to show, but left dots to be shown
|
|
75
75
|
*/
|
|
76
76
|
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
77
77
|
var rightItemCount = 3 + 2 * siblingCount;
|
|
@@ -79,8 +79,8 @@ var usePagination = function usePagination(_ref) {
|
|
|
79
79
|
return [firstPageIndex, DOTS].concat(_toConsumableArray(rightRange));
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
/*
|
|
83
|
-
Case 4: Both left and right dots to be shown
|
|
82
|
+
/*
|
|
83
|
+
Case 4: Both left and right dots to be shown
|
|
84
84
|
*/
|
|
85
85
|
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
86
86
|
var middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
var _formik = require("formik");
|
|
10
|
+
var Yup = _interopRequireWildcard(require("yup"));
|
|
11
|
+
var _Text = _interopRequireDefault(require("../Text/Text.styles"));
|
|
12
|
+
var _Button = _interopRequireDefault(require("../Button/Button.styles"));
|
|
13
|
+
var _Form = _interopRequireWildcard(require("../Form/Form"));
|
|
14
|
+
var _Input = _interopRequireDefault(require("../Input/Input"));
|
|
15
|
+
var _FAQ = _interopRequireDefault(require("../FAQ/FAQ"));
|
|
16
|
+
var _SectionTitle = _interopRequireDefault(require("../SectionTitle/SectionTitle.styles"));
|
|
17
|
+
var _ComponentWrapper = _interopRequireDefault(require("../ComponentWrapper/ComponentWrapper.styles"));
|
|
18
|
+
var _ComponentScroll = _interopRequireDefault(require("../ComponentScroll/ComponentScroll"));
|
|
19
|
+
var _Modal = require("../Modal/Modal.styles");
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
24
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
27
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
30
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
33
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
34
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
35
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
36
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
37
|
+
var AlgoAdressName = /*#__PURE__*/function (_PureComponent) {
|
|
38
|
+
_inherits(AlgoAdressName, _PureComponent);
|
|
39
|
+
var _super = _createSuper(AlgoAdressName);
|
|
40
|
+
function AlgoAdressName() {
|
|
41
|
+
var _this;
|
|
42
|
+
_classCallCheck(this, AlgoAdressName);
|
|
43
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
+
args[_key] = arguments[_key];
|
|
45
|
+
}
|
|
46
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
+
_defineProperty(_assertThisInitialized(_this), "initialValues", {
|
|
48
|
+
name: ''
|
|
49
|
+
});
|
|
50
|
+
_defineProperty(_assertThisInitialized(_this), "validationSchema", Yup.object().shape({
|
|
51
|
+
name: Yup.string().required('Address name is required')
|
|
52
|
+
}));
|
|
53
|
+
_defineProperty(_assertThisInitialized(_this), "onSubmit", function () {
|
|
54
|
+
var changeStep = _this.props.changeStep;
|
|
55
|
+
changeStep();
|
|
56
|
+
});
|
|
57
|
+
return _this;
|
|
58
|
+
}
|
|
59
|
+
_createClass(AlgoAdressName, [{
|
|
60
|
+
key: "componentDidMount",
|
|
61
|
+
value: function componentDidMount() {
|
|
62
|
+
var _this$props = this.props,
|
|
63
|
+
registeredAddress = _this$props.registeredAddress,
|
|
64
|
+
changeStep = _this$props.changeStep;
|
|
65
|
+
if (registeredAddress) {
|
|
66
|
+
changeStep();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "render",
|
|
71
|
+
value: function render() {
|
|
72
|
+
var _this2 = this;
|
|
73
|
+
var _this$props2 = this.props,
|
|
74
|
+
error = _this$props2.error,
|
|
75
|
+
isUpdatingUser = _this$props2.isUpdatingUser;
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_Modal.ModalWrapper, null, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, null, /*#__PURE__*/_react.default.createElement(_SectionTitle.default, null, "Register Algorand address")), /*#__PURE__*/_react.default.createElement(_ComponentScroll.default, null, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
77
|
+
noPaddingVertical: true
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_Text.default, null, /*#__PURE__*/_react.default.createElement("h3", null, "Name your Algorand address"), /*#__PURE__*/_react.default.createElement("p", null, "Give your address a name that reflects what it will store. Remember Satoshi's recommendation to spread your crypto investments over different addresses. "))), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, null, /*#__PURE__*/_react.default.createElement(_formik.Formik, {
|
|
79
|
+
initialValues: this.initialValues,
|
|
80
|
+
validationSchema: this.validationSchema,
|
|
81
|
+
onSubmit: this.onSubmit
|
|
82
|
+
}, function (_ref) {
|
|
83
|
+
var values = _ref.values,
|
|
84
|
+
errors = _ref.errors,
|
|
85
|
+
touched = _ref.touched,
|
|
86
|
+
handleBlur = _ref.handleBlur,
|
|
87
|
+
setFieldValue = _ref.setFieldValue,
|
|
88
|
+
setFieldTouched = _ref.setFieldTouched;
|
|
89
|
+
var onChangeWithTouch = function onChangeWithTouch(e) {
|
|
90
|
+
var setNameToRegister = _this2.props.setNameToRegister;
|
|
91
|
+
var field = e.target;
|
|
92
|
+
setFieldValue(field.name, field.value, false);
|
|
93
|
+
setFieldTouched(field.name);
|
|
94
|
+
setNameToRegister(field.value);
|
|
95
|
+
};
|
|
96
|
+
var submitDisabled = !touched.name || !!errors.name || isUpdatingUser;
|
|
97
|
+
return /*#__PURE__*/_react.default.createElement(_Form.default, null, /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
98
|
+
noPadding: true
|
|
99
|
+
}, /*#__PURE__*/_react.default.createElement(_Form.FormField, null, /*#__PURE__*/_react.default.createElement(_Input.default, {
|
|
100
|
+
id: "register-algo-name",
|
|
101
|
+
name: "name",
|
|
102
|
+
label: "Address name",
|
|
103
|
+
value: values.name,
|
|
104
|
+
onChange: onChangeWithTouch,
|
|
105
|
+
onBlur: handleBlur,
|
|
106
|
+
error: !!errors.name,
|
|
107
|
+
touched: !!touched.name
|
|
108
|
+
}), /*#__PURE__*/_react.default.createElement(_Form.FormError, {
|
|
109
|
+
show: errors.name && touched.name
|
|
110
|
+
}, errors.name))), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
111
|
+
noPaddingHorizontal: true,
|
|
112
|
+
noPaddingBottom: true,
|
|
113
|
+
center: true
|
|
114
|
+
}, /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
115
|
+
type: "submit",
|
|
116
|
+
minWidth: "240px",
|
|
117
|
+
disabled: submitDisabled
|
|
118
|
+
}, "Use this name"), /*#__PURE__*/_react.default.createElement(_Form.FormError, {
|
|
119
|
+
withTopSpacing: true,
|
|
120
|
+
show: error
|
|
121
|
+
}, error)));
|
|
122
|
+
})), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, {
|
|
123
|
+
noPaddingBottom: true
|
|
124
|
+
}, /*#__PURE__*/_react.default.createElement(_SectionTitle.default, null, "Frequently Asked Questions")), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.default, null, /*#__PURE__*/_react.default.createElement(_FAQ.default, {
|
|
125
|
+
items: [{
|
|
126
|
+
title: 'Why should I name my Algorand address?',
|
|
127
|
+
content: "If you're following best practice and spreading your crypto investments over different addresses, a name makes it easier to manage your portfolio."
|
|
128
|
+
}]
|
|
129
|
+
}))));
|
|
130
|
+
}
|
|
131
|
+
}]);
|
|
132
|
+
return AlgoAdressName;
|
|
133
|
+
}(_react.PureComponent);
|
|
134
|
+
AlgoAdressName.propTypes = {
|
|
135
|
+
changeStep: _propTypes.default.func.isRequired
|
|
136
|
+
};
|
|
137
|
+
var _default = AlgoAdressName;
|
|
138
|
+
exports.default = _default;
|