Skip to content

Commit

Permalink
💫 Update: RNIModalPresentationState
Browse files Browse the repository at this point in the history
Summary: Add property to `RNIModalPresentationState`: `isDismissedOrDismissing` + `isPresentedOrPresenting`
  • Loading branch information
dominicstop committed Apr 14, 2023
1 parent 95b3872 commit f34444e
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ public enum RNIModalPresentationState: String, CaseIterable {
public var isDismissed: Bool {
self == .DISMISSED;
};

// MARK: - Computed Properties - Composite
// ---------------------------------------

public var isDismissedOrDismissing: Bool {
self.isDismissed || self.isDismissing;
};

public var isPresentedOrPresenting: Bool {
self.isPresented || self.isPresenting;
};
};

public struct RNIModalPresentationStateMachine {
Expand Down Expand Up @@ -157,10 +168,6 @@ public struct RNIModalPresentationStateMachine {
self._isInitialPresent ?? true;
};

public var wasCancelledPresent: Bool {
self._wasCancelledPresent || self.wasCancelledDismissViaGesture;
};

public var isPresented: Bool {
self.state.isPresented
};
Expand Down

0 comments on commit f34444e

Please sign in to comment.