intelicoreact 1.2.54 → 1.2.55
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.
|
@@ -91,13 +91,12 @@ var Modal = /*#__PURE__*/_react.default.forwardRef(function (_ref2, ref) {
|
|
|
91
91
|
customFooter = _ref2.customFooter,
|
|
92
92
|
testId = _ref2.testId,
|
|
93
93
|
noHeaderCloseBtn = _ref2.noHeaderCloseBtn,
|
|
94
|
-
|
|
95
|
-
noMobileModalLogic = _ref2$noMobileModalLo === void 0 ? true : _ref2$noMobileModalLo;
|
|
94
|
+
withMobileLogic = _ref2.withMobileLogic;
|
|
96
95
|
var modalRef = ref || (0, _react.useRef)(null);
|
|
97
96
|
|
|
98
97
|
var _useMobileModal = (0, _useMobileModal2.default)({
|
|
99
98
|
modalRef: modalRef,
|
|
100
|
-
|
|
99
|
+
withMobileLogic: withMobileLogic,
|
|
101
100
|
isOpen: isOpen
|
|
102
101
|
}),
|
|
103
102
|
modalMobileHeaderRef = _useMobileModal.modalMobileHeaderRef,
|
|
@@ -35,8 +35,8 @@ function useMobileModal(_ref) {
|
|
|
35
35
|
|
|
36
36
|
var _ref$modalRef = _ref.modalRef,
|
|
37
37
|
modalRef = _ref$modalRef === void 0 ? null : _ref$modalRef,
|
|
38
|
-
_ref$
|
|
39
|
-
|
|
38
|
+
_ref$withMobileLogic = _ref.withMobileLogic,
|
|
39
|
+
withMobileLogic = _ref$withMobileLogic === void 0 ? false : _ref$withMobileLogic,
|
|
40
40
|
isOpen = _ref.isOpen;
|
|
41
41
|
var modalMobileContainerRef = (0, _react.useRef)(null);
|
|
42
42
|
var modalMobileHeaderRef = (0, _react.useRef)(null);
|
|
@@ -139,7 +139,7 @@ function useMobileModal(_ref) {
|
|
|
139
139
|
}
|
|
140
140
|
});
|
|
141
141
|
(0, _react.useEffect)(function () {
|
|
142
|
-
if (isMobile &&
|
|
142
|
+
if (isMobile && withMobileLogic) {
|
|
143
143
|
var footerBottom = modalsLogicProps.footerBottom,
|
|
144
144
|
footerHeight = modalsLogicProps.footerHeight,
|
|
145
145
|
headerTop = modalsLogicProps.headerTop,
|
|
@@ -151,7 +151,7 @@ function useMobileModal(_ref) {
|
|
|
151
151
|
IS_FOOTER_STICKY: footerBottom <= 0
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
|
-
}, [isMobile,
|
|
154
|
+
}, [isMobile, withMobileLogic, scrollDirection, modalsLogicProps, modalHeight]);
|
|
155
155
|
(0, _react.useLayoutEffect)(function () {
|
|
156
156
|
setModalsLogicProps(function (state) {
|
|
157
157
|
var _modalMobileContainer5, _modalMobileContainer6;
|
|
@@ -207,7 +207,7 @@ function useMobileModal(_ref) {
|
|
|
207
207
|
};
|
|
208
208
|
|
|
209
209
|
var renderModal = function renderModal(modal) {
|
|
210
|
-
return isMobile &&
|
|
210
|
+
return isMobile && withMobileLogic ? renderMobileModal(modal) : modal;
|
|
211
211
|
};
|
|
212
212
|
|
|
213
213
|
return {
|