@stokr/components-library 2.1.8 → 2.2.0
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/dist/components/CryptoAddress/CryptoAddress.js +11 -4
- package/dist/components/CryptoAddress/CryptoAddress.styles.js +3 -1
- package/dist/components/CryptoAddress/RadioWrap.js +4 -2
- package/dist/components/FAQ/FAQ.js +2 -2
- package/dist/components/Input/Input.js +3 -2
- package/dist/components/Input/InputWithButton.stories.js +1 -1
- package/dist/components/headerHo/HeaderHo.js +8 -1
- package/dist/index.js +11 -0
- package/dist/utils/check-sale-time-left.js +1 -1
- package/dist/utils/fix-decimals.js +6 -3
- package/package.json +1 -1
|
@@ -40,11 +40,13 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
40
40
|
flexHead = _ref.flexHead,
|
|
41
41
|
fontSize = _ref.fontSize,
|
|
42
42
|
eqValueFontSize = _ref.eqValueFontSize,
|
|
43
|
+
eqValueStyle = _ref.eqValueStyle,
|
|
43
44
|
titleColor = _ref.titleColor,
|
|
44
45
|
dataBoxStyle = _ref.dataBoxStyle,
|
|
45
46
|
headStyle = _ref.headStyle,
|
|
46
47
|
infoBoxStyle = _ref.infoBoxStyle,
|
|
47
|
-
wrapperStyle = _ref.wrapperStyle
|
|
48
|
+
wrapperStyle = _ref.wrapperStyle,
|
|
49
|
+
bodyStyle = _ref.bodyStyle;
|
|
48
50
|
var _useState = (0, _react.useState)(false),
|
|
49
51
|
_useState2 = _slicedToArray(_useState, 2),
|
|
50
52
|
copiedAddressToClipboard = _useState2[0],
|
|
@@ -85,7 +87,8 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
85
87
|
objectFit: 'contain'
|
|
86
88
|
}
|
|
87
89
|
}))), /*#__PURE__*/_react.default.createElement(_CryptoAddress.Body, {
|
|
88
|
-
noBody: noBody
|
|
90
|
+
noBody: noBody,
|
|
91
|
+
style: bodyStyle
|
|
89
92
|
}, /*#__PURE__*/_react.default.createElement(_CryptoAddress.DataBox, {
|
|
90
93
|
style: dataBoxStyle
|
|
91
94
|
}, data.value && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Value, {
|
|
@@ -100,11 +103,15 @@ var CryptoAddress = function CryptoAddress(_ref) {
|
|
|
100
103
|
margin: 0
|
|
101
104
|
}
|
|
102
105
|
}, (0, _getShortAddress.default)(data.value)) : data.value, data.tooltip && /*#__PURE__*/_react.default.createElement("div", null, copyToClipBoard(data.value, copiedAddressToClipboard, setCopiedAddressToClipboard))), data.eqValue && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Equal, {
|
|
103
|
-
fontSize: eqValueFontSize
|
|
106
|
+
fontSize: eqValueFontSize,
|
|
107
|
+
style: {
|
|
108
|
+
eqValueStyle: eqValueStyle
|
|
109
|
+
}
|
|
104
110
|
}, '= ', data.eqUnit && "".concat(data.eqUnit, " "), data.eqValue)), /*#__PURE__*/_react.default.createElement(_CryptoAddress.InfoBox, {
|
|
105
111
|
style: infoBoxStyle
|
|
106
112
|
}, /*#__PURE__*/_react.default.createElement(_CryptoAddress.Value, null, info.unit && /*#__PURE__*/_react.default.createElement("strong", null, info.unit), info.value), info.eqValue && /*#__PURE__*/_react.default.createElement(_CryptoAddress.Equal, {
|
|
107
|
-
fontSize: eqValueFontSize
|
|
113
|
+
fontSize: eqValueFontSize,
|
|
114
|
+
style: eqValueStyle
|
|
108
115
|
}, info.noEqualsToSign ? ' ' : '= ', info.eqUnit && /*#__PURE__*/_react.default.createElement("strong", null, info.eqUnit), " ".concat(info.eqValue)))), sideOptions && /*#__PURE__*/_react.default.createElement(_CryptoAddress.OptionsWrapper, null, sideOptions)))));
|
|
109
116
|
};
|
|
110
117
|
exports.CryptoAddress = CryptoAddress;
|
|
@@ -139,10 +139,12 @@ exports.CheckMark = CheckMark;
|
|
|
139
139
|
var Radio = _styledComponents.default.div.withConfig({
|
|
140
140
|
displayName: "CryptoAddressstyles__Radio",
|
|
141
141
|
componentId: "sc-1wjvdgu-16"
|
|
142
|
-
})(["& > input{", ";z-index:-1;position:absolute;top:4px;left:4px;display:block;width:1px;height:0;opacity:0;border:0;& + label{display:block;position:relative;", "
|
|
142
|
+
})(["& > input{", ";z-index:-1;position:absolute;top:4px;left:4px;display:block;width:1px;height:0;opacity:0;border:0;& + label{display:block;position:relative;", ";", "}&:disabled + label{&:before{background-color:transparent !important;}", "{border-color:", "!important;background-color:", "!important;}}&:checked + label{&:before{background-color:", "!important;}", "{&:before,&:after{opacity:1;transform:scale(1);transition:opacity 0.2s,transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275);}}}&:focus + label,&:hover + label,& + label:hover{&:before{background-color:", ";}", "{border-color:", ";}}}"], function (props) {
|
|
143
143
|
return props.hide && 'visibility: hidden';
|
|
144
144
|
}, function (props) {
|
|
145
145
|
return !props.disabled && 'cursor: pointer';
|
|
146
|
+
}, function (props) {
|
|
147
|
+
return !props.hideLine && "\n &:before {\n content: '';\n width: 6px;\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n background-color: transparent;\n transition: background-color 0.2s;\n }\n ";
|
|
146
148
|
}, CheckMark, function (props) {
|
|
147
149
|
return _theme.default.cLightGrey;
|
|
148
150
|
}, function (props) {
|
|
@@ -21,7 +21,8 @@ var RadioWrap = function RadioWrap(_ref) {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
return radio ? /*#__PURE__*/_react.default.createElement(_CryptoAddress.Radio, {
|
|
24
|
-
hide: radio.hide
|
|
24
|
+
hide: radio.hide,
|
|
25
|
+
hideLine: radio.hideLine
|
|
25
26
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
26
27
|
type: "radio",
|
|
27
28
|
id: radio.id,
|
|
@@ -46,7 +47,8 @@ RadioWrap.propTypes = {
|
|
|
46
47
|
checked: _propTypes.default.bool,
|
|
47
48
|
onChange: _propTypes.default.func,
|
|
48
49
|
onBlur: _propTypes.default.func,
|
|
49
|
-
hide: _propTypes.default.bool
|
|
50
|
+
hide: _propTypes.default.bool,
|
|
51
|
+
hideLine: _propTypes.default.bool
|
|
50
52
|
})
|
|
51
53
|
};
|
|
52
54
|
RadioWrap.defaultProps = {
|
|
@@ -34,10 +34,10 @@ var FAQ = function FAQ(props) {
|
|
|
34
34
|
if (!noScroll && newActiveIndex !== null) {
|
|
35
35
|
//we pass scroll ref if we use FAQ in modal
|
|
36
36
|
//scroll ref is pointing to scroll element in modal
|
|
37
|
-
if (scrollRef.current) {
|
|
37
|
+
if (scrollRef !== null && scrollRef !== void 0 && scrollRef.current) {
|
|
38
38
|
//we put timeout bc when faq item opens, it needs some time to re-render the scroll of the modal
|
|
39
39
|
setTimeout(function () {
|
|
40
|
-
scrollRef.current.scrollToBottom();
|
|
40
|
+
scrollRef === null || scrollRef === void 0 || scrollRef.current.scrollToBottom();
|
|
41
41
|
}, 0);
|
|
42
42
|
} else {
|
|
43
43
|
scrollToElement(e.target.parentElement, {
|
|
@@ -11,6 +11,7 @@ var _Input = require("./Input.styles");
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
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); }
|
|
13
13
|
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; }
|
|
14
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
14
15
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
16
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
17
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -74,7 +75,7 @@ var Input = function Input(props) {
|
|
|
74
75
|
}, label), /*#__PURE__*/_react.default.createElement(_Input.InputWrap, {
|
|
75
76
|
error: error && touched,
|
|
76
77
|
dashboard: dashboard
|
|
77
|
-
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
78
79
|
type: type,
|
|
79
80
|
id: id,
|
|
80
81
|
name: name,
|
|
@@ -88,7 +89,7 @@ var Input = function Input(props) {
|
|
|
88
89
|
WebkitAppearance: 'none',
|
|
89
90
|
WebkitBorderRadius: 0
|
|
90
91
|
}
|
|
91
|
-
})));
|
|
92
|
+
}, props))));
|
|
92
93
|
};
|
|
93
94
|
exports.Input = Input;
|
|
94
95
|
Input.propTypes = {
|
|
@@ -58,7 +58,7 @@ var _default = {
|
|
|
58
58
|
};
|
|
59
59
|
exports.default = _default;
|
|
60
60
|
var Template = function Template(args) {
|
|
61
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_InputWithButton.InputWithButton,
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_global.default, null), /*#__PURE__*/_react.default.createElement(_ComponentWrapper.ComponentWrapper, null, /*#__PURE__*/_react.default.createElement(_InputWithButton.InputWithButton, args, /*#__PURE__*/_react.default.createElement(_Button.Button, null, "apply"))));
|
|
62
62
|
};
|
|
63
63
|
var InputButton = Template.bind({});
|
|
64
64
|
exports.InputButton = InputButton;
|
|
@@ -738,7 +738,14 @@ var HeaderHoClass = /*#__PURE__*/function (_Component) {
|
|
|
738
738
|
_this2.setOpenModalStatus('confirmReset', false);
|
|
739
739
|
},
|
|
740
740
|
onModalSwitch: function onModalSwitch() {
|
|
741
|
-
_this2.
|
|
741
|
+
var location = _this2.props.location;
|
|
742
|
+
var query = new URLSearchParams(location === null || location === void 0 ? void 0 : location.search);
|
|
743
|
+
var userType = query.get('user_type');
|
|
744
|
+
if (userType && userType === 'sa') {
|
|
745
|
+
window.open("https://backoffice.".concat(process.env.REACT_APP_WEBSITE_DOMAIN));
|
|
746
|
+
} else {
|
|
747
|
+
_this2.switchOpenModal('confirmReset', 'login');
|
|
748
|
+
}
|
|
742
749
|
}
|
|
743
750
|
}), !isVerifyingEmail && /*#__PURE__*/_react.default.createElement(_VerifyEmailModal.default, {
|
|
744
751
|
id: "verify-email-popup",
|
package/dist/index.js
CHANGED
|
@@ -1147,6 +1147,17 @@ Object.keys(_checkTodoStatus).forEach(function (key) {
|
|
|
1147
1147
|
}
|
|
1148
1148
|
});
|
|
1149
1149
|
});
|
|
1150
|
+
var _fixDecimals = require("./utils/fix-decimals");
|
|
1151
|
+
Object.keys(_fixDecimals).forEach(function (key) {
|
|
1152
|
+
if (key === "default" || key === "__esModule") return;
|
|
1153
|
+
if (key in exports && exports[key] === _fixDecimals[key]) return;
|
|
1154
|
+
Object.defineProperty(exports, key, {
|
|
1155
|
+
enumerable: true,
|
|
1156
|
+
get: function get() {
|
|
1157
|
+
return _fixDecimals[key];
|
|
1158
|
+
}
|
|
1159
|
+
});
|
|
1160
|
+
});
|
|
1150
1161
|
var _FA = require("./components/2FA");
|
|
1151
1162
|
Object.keys(_FA).forEach(function (key) {
|
|
1152
1163
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -62,7 +62,7 @@ var checkSaleTimeLeft = function checkSaleTimeLeft(project) {
|
|
|
62
62
|
//if we have variable tranche we set opening and closing date of tranche
|
|
63
63
|
timeLeftData.openingTime = currentTranche.startDate;
|
|
64
64
|
timeLeftData.closingTime = currentTranche.endDate;
|
|
65
|
-
if (today < new Date(currentTranche.endDate)) {
|
|
65
|
+
if (today >= new Date(currentTranche.startDate) && today < new Date(currentTranche.endDate)) {
|
|
66
66
|
timeLeftData.isOpen = true;
|
|
67
67
|
timeLeftData.hasClosed = false;
|
|
68
68
|
} else if (today > new Date(currentTranche.endDate)) {
|
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.fixDecimals = exports.default = void 0;
|
|
7
7
|
// Convert to float; fix decimals; convert to string; return
|
|
8
|
-
var
|
|
9
|
-
|
|
8
|
+
var fixDecimals = function fixDecimals(value, decimals) {
|
|
9
|
+
var roundingFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Math.round;
|
|
10
|
+
return (roundingFn(Number(value) * Math.pow(10, decimals)) / Math.pow(10, decimals)).toFixed(decimals);
|
|
10
11
|
};
|
|
12
|
+
exports.fixDecimals = fixDecimals;
|
|
13
|
+
var _default = fixDecimals;
|
|
11
14
|
exports.default = _default;
|