Skip to content

Commit

Permalink
Fix lint for BaseModal
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejkustra committed Jan 17, 2025
1 parent b6eaff0 commit 048c2e8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/components/Modal/BaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import useWindowDimensions from '@hooks/useWindowDimensions';
import ComposerFocusManager from '@libs/ComposerFocusManager';
import Overlay from '@libs/Navigation/AppNavigator/Navigators/Overlay';
import variables from '@styles/variables';
import * as Modal from '@userActions/Modal';
import {areAllModalsHidden, closeTop, onModalDidClose, setCloseModal, setModalVisibility, willAlertModalBecomeVisible} from '@userActions/Modal';
import CONST from '@src/CONST';
import ModalContent from './ModalContent';
import ModalContext from './ModalContext';
Expand Down Expand Up @@ -84,16 +84,16 @@ function BaseModal(
*/
const hideModal = useCallback(
(callHideCallback = true) => {
if (Modal.areAllModalsHidden()) {
Modal.willAlertModalBecomeVisible(false);
if (areAllModalsHidden()) {
willAlertModalBecomeVisible(false);
if (shouldSetModalVisibility) {
Modal.setModalVisibility(false);
setModalVisibility(false);
}
}
if (callHideCallback) {
onModalHide();
}
Modal.onModalDidClose();
onModalDidClose();
ComposerFocusManager.refocusAfterModalFullyClosed(uniqueModalId, restoreFocusType);
},
[shouldSetModalVisibility, onModalHide, restoreFocusType, uniqueModalId],
Expand All @@ -103,9 +103,9 @@ function BaseModal(
isVisibleRef.current = isVisible;
let removeOnCloseListener: () => void;
if (isVisible) {
Modal.willAlertModalBecomeVisible(true, type === CONST.MODAL.MODAL_TYPE.POPOVER || type === CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED);
willAlertModalBecomeVisible(true, type === CONST.MODAL.MODAL_TYPE.POPOVER || type === CONST.MODAL.MODAL_TYPE.BOTTOM_DOCKED);
// To handle closing any modal already visible when this modal is mounted, i.e. PopoverReportActionContextMenu
removeOnCloseListener = Modal.setCloseModal(onClose);
removeOnCloseListener = setCloseModal(onClose);
}

return () => {
Expand All @@ -130,7 +130,7 @@ function BaseModal(

const handleShowModal = () => {
if (shouldSetModalVisibility) {
Modal.setModalVisibility(true);
setModalVisibility(true);
}
onModalShow();
};
Expand Down Expand Up @@ -230,7 +230,7 @@ function BaseModal(
onBackdropPress={handleBackdropPress}
// Note: Escape key on web/desktop will trigger onBackButtonPress callback
// eslint-disable-next-line react/jsx-props-no-multi-spaces
onBackButtonPress={Modal.closeTop}
onBackButtonPress={closeTop}
onModalShow={handleShowModal}
propagateSwipe={propagateSwipe}
onModalHide={hideModal}
Expand Down

0 comments on commit 048c2e8

Please sign in to comment.