intelicoreact 1.2.34 → 1.2.35

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.
@@ -90,7 +90,7 @@ function useMobileModal(_ref) {
90
90
  // Detect Mobile
91
91
 
92
92
 
93
- (0, _react.useLayoutEffect)(function () {
93
+ (0, _react.useEffect)(function () {
94
94
  if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) setIsMobile(true);
95
95
  }, [navigator.userAgent]); // Count ScrollTop
96
96
 
@@ -107,7 +107,7 @@ function useMobileModal(_ref) {
107
107
  }
108
108
  }, [modalMobileContainerRef === null || modalMobileContainerRef === void 0 ? void 0 : modalMobileContainerRef.current]); // Count ScrollDirection
109
109
 
110
- (0, _react.useLayoutEffect)(function () {
110
+ (0, _react.useEffect)(function () {
111
111
  setScrollDirection(scrollTop < scrollTopPrev ? SCROLL_DIRECTION.UP : SCROLL_DIRECTION.DOWN);
112
112
  }, [scrollTop, scrollTopPrev]); // Dynamic Modal Positioning
113
113
 
@@ -142,17 +142,22 @@ function useMobileModal(_ref) {
142
142
  }
143
143
  }
144
144
  });
145
- (0, _react.useLayoutEffect)(function () {
146
- var footerBottom = modalsLogicProps.footerBottom,
147
- footerHeight = modalsLogicProps.footerHeight,
148
- headerTop = modalsLogicProps.headerTop,
149
- bodyTop = modalsLogicProps.bodyTop;
150
- setModalsLogic({
151
- IS_HEADER_HIDDEN: !isMobile || noMobileModalLogic ? false : footerBottom * -1 <= footerHeight || scrollDirection === SCROLL_DIRECTION.DOWN,
152
- IS_HEADER_STICKY: !isMobile || noMobileModalLogic ? false : headerTop <= 0,
153
- IS_FOOTER_HIDDEN: !isMobile || noMobileModalLogic ? false : bodyTop > 0 || scrollDirection === SCROLL_DIRECTION.UP,
154
- IS_FOOTER_STICKY: !isMobile || noMobileModalLogic ? false : footerBottom <= 0
155
- });
145
+ (0, _react.useEffect)(function () {
146
+ if (isMobile && !noMobileModalLogic) {
147
+ var footerBottom = modalsLogicProps.footerBottom,
148
+ footerHeight = modalsLogicProps.footerHeight,
149
+ headerTop = modalsLogicProps.headerTop,
150
+ bodyTop = modalsLogicProps.bodyTop;
151
+ console.log({
152
+ footerBottom: footerBottom
153
+ });
154
+ setModalsLogic({
155
+ IS_HEADER_HIDDEN: footerBottom * -1 <= footerHeight || scrollDirection === SCROLL_DIRECTION.DOWN,
156
+ IS_HEADER_STICKY: headerTop <= 0,
157
+ IS_FOOTER_HIDDEN: bodyTop > 0 || scrollDirection === SCROLL_DIRECTION.UP,
158
+ IS_FOOTER_STICKY: footerBottom <= 0
159
+ });
160
+ }
156
161
  }, [isMobile, noMobileModalLogic, scrollDirection, modalsLogicProps, modalHeight]);
157
162
  (0, _react.useLayoutEffect)(function () {
158
163
  setModalsLogicProps(function (state) {
@@ -186,7 +191,7 @@ function useMobileModal(_ref) {
186
191
  var _modalMobileFooterRef, _modalMobileFooterRef2;
187
192
 
188
193
  return _objectSpread(_objectSpread({}, state), {}, {
189
- footerBottom: modalsLogicProps.modalMobileContainerHeight - (modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef = modalMobileFooterRef.current) === null || _modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef2 = _modalMobileFooterRef.getBoundingClientRect()) === null || _modalMobileFooterRef2 === void 0 ? void 0 : _modalMobileFooterRef2.bottom)
194
+ footerBottom: parseInt(modalsLogicProps.modalMobileContainerHeight - (modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef = modalMobileFooterRef.current) === null || _modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef2 = _modalMobileFooterRef.getBoundingClientRect()) === null || _modalMobileFooterRef2 === void 0 ? void 0 : _modalMobileFooterRef2.bottom))
190
195
  });
191
196
  });
192
197
  }, [modalsLogicProps.modalMobileContainerHeight, modalMobileFooterRef === null || modalMobileFooterRef === void 0 ? void 0 : (_modalMobileFooterRef3 = modalMobileFooterRef.current) === null || _modalMobileFooterRef3 === void 0 ? void 0 : (_modalMobileFooterRef4 = _modalMobileFooterRef3.getBoundingClientRect()) === null || _modalMobileFooterRef4 === void 0 ? void 0 : _modalMobileFooterRef4.bottom]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.2.34",
3
+ "version": "1.2.35",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [