trepur_components 0.2.16 → 0.2.19
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.
|
@@ -40,7 +40,6 @@ const InformationIcon = _ref => {
|
|
|
40
40
|
hoverBgColor,
|
|
41
41
|
withAnimation
|
|
42
42
|
} = _ref;
|
|
43
|
-
const [isHovering, setIsHovering] = (0, _react.useState)(false);
|
|
44
43
|
let loaded = (0, _react.useRef)(false);
|
|
45
44
|
let imageClassList = 'mx-auto pt-2 ';
|
|
46
45
|
imageClassList += imageClasses ? imageClasses : '';
|
|
@@ -70,12 +69,12 @@ const InformationIcon = _ref => {
|
|
|
70
69
|
};
|
|
71
70
|
|
|
72
71
|
(0, _react.useEffect)(() => {
|
|
73
|
-
const element = document.getElementById('
|
|
72
|
+
const element = document.getElementById(id + '_number');
|
|
74
73
|
let observer = new IntersectionObserver((entries, observer) => {
|
|
75
74
|
entries.forEach(entry => {
|
|
76
75
|
if (entry.intersectionRatio >= 0.1 && loaded.current == false) {
|
|
77
76
|
loaded.current = true;
|
|
78
|
-
counterAnimation(document.getElementById('
|
|
77
|
+
counterAnimation(document.getElementById(id + '_number'), 0, number, 3000);
|
|
79
78
|
} else {}
|
|
80
79
|
});
|
|
81
80
|
}, {
|
|
@@ -89,10 +88,8 @@ const InformationIcon = _ref => {
|
|
|
89
88
|
color: textColor ? textColor : 'black'
|
|
90
89
|
});
|
|
91
90
|
|
|
92
|
-
const setHoverState =
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (isHovering === true) {
|
|
91
|
+
const setHoverState = isHovering => {
|
|
92
|
+
if (isHovering) {
|
|
96
93
|
setStyles({
|
|
97
94
|
'background-color': hoverBgColor ? hoverBgColor : 'white',
|
|
98
95
|
color: hoverTextColor ? hoverTextColor : 'black'
|
|
@@ -111,14 +108,14 @@ const InformationIcon = _ref => {
|
|
|
111
108
|
}, {
|
|
112
109
|
style: styles,
|
|
113
110
|
className: classList,
|
|
114
|
-
onMouseOver: () => setHoverState(),
|
|
115
|
-
onMouseOut: () => setHoverState()
|
|
111
|
+
onMouseOver: () => setHoverState(true),
|
|
112
|
+
onMouseOut: () => setHoverState(false)
|
|
116
113
|
}), type && /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
117
114
|
type: type,
|
|
118
|
-
size:
|
|
115
|
+
size: size,
|
|
119
116
|
classes: imageClassList
|
|
120
117
|
}), number && /*#__PURE__*/_react.default.createElement("p", {
|
|
121
|
-
id:
|
|
118
|
+
id: id + '_number',
|
|
122
119
|
className: numberClasses
|
|
123
120
|
}, number), /*#__PURE__*/_react.default.createElement("p", {
|
|
124
121
|
className: textClasses
|