@stokr/components-library 2.3.69 → 2.3.71
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.
|
@@ -55,6 +55,8 @@ const Main2FAFlow = _ref => {
|
|
|
55
55
|
const [successMessage, setsuccessMessage] = (0, _react.useState)();
|
|
56
56
|
const [isLoginRequired, setisLoginRequired] = (0, _react.useState)(false);
|
|
57
57
|
const [totpData, settotpData] = (0, _react.useState)();
|
|
58
|
+
const enable2faCompletedRef = (0, _react.useRef)(false);
|
|
59
|
+
const disable2faCompletedRef = (0, _react.useRef)(false);
|
|
58
60
|
(0, _react.useEffect)(() => {
|
|
59
61
|
if ((userMfaEnrollment === null || userMfaEnrollment === void 0 ? void 0 : userMfaEnrollment.length) > 0) {
|
|
60
62
|
setis2FAEnabled(true);
|
|
@@ -94,18 +96,24 @@ const Main2FAFlow = _ref => {
|
|
|
94
96
|
};
|
|
95
97
|
|
|
96
98
|
// Helper to close a flow and call the custom onFlowClose handler
|
|
97
|
-
const handleFlowClose = flowId
|
|
99
|
+
const handleFlowClose = function (flowId) {
|
|
100
|
+
let completed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
98
101
|
setIsFlowOpen(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
99
102
|
[flowId]: false
|
|
100
103
|
}));
|
|
101
|
-
onFlowClose && onFlowClose(
|
|
104
|
+
onFlowClose && onFlowClose({
|
|
105
|
+
flow: flowId,
|
|
106
|
+
completed
|
|
107
|
+
});
|
|
102
108
|
};
|
|
103
109
|
const onEnable2FASuccess = async () => {
|
|
110
|
+
enable2faCompletedRef.current = true;
|
|
104
111
|
setis2FAEnabled(true);
|
|
105
112
|
checkMfaEnrollment();
|
|
106
113
|
setsuccessMessage('Your log in 2FA authentication is now set');
|
|
107
114
|
};
|
|
108
115
|
const onDisable2FASuccess = async () => {
|
|
116
|
+
disable2faCompletedRef.current = true;
|
|
109
117
|
setis2FAEnabled(false);
|
|
110
118
|
checkMfaEnrollment();
|
|
111
119
|
setsuccessMessage('Your log in 2FA authentication is removed');
|
|
@@ -187,7 +195,7 @@ const Main2FAFlow = _ref => {
|
|
|
187
195
|
showFlow: isFlowopen.enable2fa,
|
|
188
196
|
setShowFlow: value => {
|
|
189
197
|
if (!value) {
|
|
190
|
-
handleFlowClose('enable2fa');
|
|
198
|
+
handleFlowClose('enable2fa', enable2faCompletedRef.current);
|
|
191
199
|
} else {
|
|
192
200
|
setIsFlowOpen(_objectSpread(_objectSpread({}, isFlowopen), {}, {
|
|
193
201
|
enable2fa: value
|
|
@@ -201,7 +209,7 @@ const Main2FAFlow = _ref => {
|
|
|
201
209
|
showFlow: isFlowopen.disable2fa,
|
|
202
210
|
setShowFlow: value => {
|
|
203
211
|
if (!value) {
|
|
204
|
-
handleFlowClose('disable2fa');
|
|
212
|
+
handleFlowClose('disable2fa', disable2faCompletedRef.current);
|
|
205
213
|
} else {
|
|
206
214
|
setIsFlowOpen(_objectSpread(_objectSpread({}, isFlowopen), {}, {
|
|
207
215
|
disable2fa: value
|
|
@@ -179,6 +179,7 @@ const useNewVentureForm = _ref => {
|
|
|
179
179
|
const updatedUser = updateUserSubscription(user, project, updates);
|
|
180
180
|
setUser(updatedUser);
|
|
181
181
|
setFormValues(prev => _objectSpread(_objectSpread({}, prev), {}, {
|
|
182
|
+
email: values.email,
|
|
182
183
|
successMessage: customSuccessMessage ? customSuccessMessage : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Please continue onboarding, an account manager will reach out to you.", /*#__PURE__*/_react.default.createElement("br", null), "If you are an existing account holder, kindly log in and make sure your account is fully verified."),
|
|
183
184
|
errorMessage: null,
|
|
184
185
|
isSubmitting: false
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" id="Eth--Streamline-Cryptocurrency-Black" height="16" width="16">
|
|
2
|
+
<desc>
|
|
3
|
+
Eth Streamline Icon: https://streamlinehq.com
|
|
4
|
+
</desc>
|
|
5
|
+
<path fill="#000000" fill-rule="evenodd" d="M8 15.840000000000002C3.6698666666666666 15.840000000000002 0.16 12.330133333333334 0.16 8S3.6698666666666666 0.16 8 0.16 15.840000000000002 3.6698666666666666 15.840000000000002 8 12.330133333333334 15.840000000000002 8 15.840000000000002Zm3.9170424242424247 -7.732703030303031L8.244024242424242 2.1199999999999997 4.569987878787878 8.107781818181818l3.6740363636363638 2.1329939393939394 3.6730181818181817 -2.1334787878787878Zm0.002957575757575758 0.6845575757575757 -3.6759757575757575 2.1319757575757574 -3.6740363636363638 -2.131490909090909 3.6740363636363638 5.085236363636364 3.6759757575757575 -5.0857212121212125Z" clip-rule="evenodd" stroke-width="0.4848"></path>
|
|
6
|
+
<path fill="#000000" fill-opacity=".298" d="M8.244024242424242 2.1199999999999997v4.346278787878788l3.6735030303030305 1.6415030303030305 -3.6735030303030305 -5.987781818181818Zm0 8.804315151515151v2.953260606060606l3.6759757575757575 -5.0857212121212125 -3.6759757575757575 2.132460606060606Z" stroke-width="0.4848"></path>
|
|
7
|
+
<path fill="#000000" fill-opacity=".801" d="m8.244024242424242 10.240824242424242 3.6735030303030305 -2.1329939393939394 -3.6735030303030305 -1.6404848484848487v3.773478787878788Z" stroke-width="0.4848"></path>
|
|
8
|
+
<path fill="#000000" fill-opacity=".298" d="m4.569987878787878 8.107830303030303 3.6740363636363638 2.1329939393939394v-3.773478787878788l-3.6740363636363638 1.6404848484848487Z" stroke-width="0.4848"></path>
|
|
9
|
+
</svg>
|
|
@@ -8,6 +8,7 @@ var _usdcLogo = _interopRequireDefault(require("../static/images/usdc-logo.svg")
|
|
|
8
8
|
var _usdqLogo = _interopRequireDefault(require("../static/images/usdq-logo.png"));
|
|
9
9
|
var _bitcoinLogo = _interopRequireDefault(require("../static/images/bitcoin-logo.svg"));
|
|
10
10
|
var _bmn2Logo = _interopRequireDefault(require("../static/images/bmn2-logo.svg"));
|
|
11
|
+
var _eth_logo = _interopRequireDefault(require("../static/images/eth_logo.svg"));
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
const formatCurrencyValue = function (currency, value) {
|
|
13
14
|
let tokenDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
|
@@ -36,7 +37,7 @@ const formatCurrencyValue = function (currency, value) {
|
|
|
36
37
|
'btc-fb': ['BTC', 8],
|
|
37
38
|
'usdc-fb': ['USDC', 2],
|
|
38
39
|
'usdq-fb': ['USDQ', 2],
|
|
39
|
-
|
|
40
|
+
xaut: ['XAUt', 6]
|
|
40
41
|
}[currency] || [currency, tokenDecimals];
|
|
41
42
|
const formattedValue = parseFloat(Math.abs(value)).toFixed(decimals);
|
|
42
43
|
return valueFirst ? "".concat(formattedValue, " ").concat(symbol) : "".concat(symbol, " ").concat(formattedValue);
|
|
@@ -59,7 +60,8 @@ const getCurrencySymbol = currencySelected => ({
|
|
|
59
60
|
'btc-fb': 'BTC',
|
|
60
61
|
'usdc-fb': 'USDC',
|
|
61
62
|
'usdq-fb': 'USDQ',
|
|
62
|
-
|
|
63
|
+
xaut: 'XAUt',
|
|
64
|
+
'eth-fb': 'ETH'
|
|
63
65
|
})[currencySelected] || currencySelected;
|
|
64
66
|
exports.getCurrencySymbol = getCurrencySymbol;
|
|
65
67
|
const getProjectCurrencySign = tokenCurrency => {
|
|
@@ -82,6 +84,9 @@ const getCurrencyIcon = (currency, customIcon) => {
|
|
|
82
84
|
return _usdqLogo.default;
|
|
83
85
|
case 'bmn2':
|
|
84
86
|
return _bmn2Logo.default;
|
|
87
|
+
case 'eth':
|
|
88
|
+
case 'eth-fb':
|
|
89
|
+
return _eth_logo.default;
|
|
85
90
|
default:
|
|
86
91
|
return null;
|
|
87
92
|
}
|