Skip to content

Commit

Permalink
⭐️ Impl: Types - Add ModalView Param Types
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Jan 9, 2023
1 parent cc38f21 commit b1f0687
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/components/ModalView/ModalView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ export class ModalView extends
return this.emitter;
};

setVisibility = async (nextVisible, childProps = null) => {
setVisibility = async (
nextVisible: boolean,
childProps: object | null = null
) => {
const { shouldMountModalContent: prevVisible } = this.state;

const didChange = (prevVisible !== nextVisible);
Expand Down Expand Up @@ -230,20 +233,27 @@ export class ModalView extends
}
};

setEnableSwipeGesture = async (enableSwipeGesture) => {
setEnableSwipeGesture = async (
enableSwipeGesture: boolean
) => {
const { enableSwipeGesture: prevVal } = this.state;
if (prevVal !== enableSwipeGesture) {
await Helpers.setStateAsync(this, { enableSwipeGesture });
}
};

setIsModalInPresentation = async (isModalInPresentation) => {
setIsModalInPresentation = async (
isModalInPresentation: boolean
) => {
const { isModalInPresentation: prevVal } = this.state;
if (prevVal !== isModalInPresentation) {
await Helpers.setStateAsync(this, { isModalInPresentation });
}
};

// Event Handlers
// --------------

// We don't want any responder events bubbling out of the modal.
_shouldSetResponder() {
return true;
Expand Down

0 comments on commit b1f0687

Please sign in to comment.