Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions example/demo-components/src/DemoScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type DemoCase = {

export const DemoScreen = () => {
const { colors } = useTheme();
const { colors } = useTheme();

const [activeCases, setActiveCases] = useState<DemoCase[]>([]);

Expand Down Expand Up @@ -180,22 +179,16 @@ export const DemoScreen = () => {
return (
<SafeAreaView
style={[styles.safeArea, { backgroundColor: colors.background }]}
>
style={[styles.safeArea, { backgroundColor: colors.background }]}
>
<ScrollView
style={styles.scroll}
contentContainerStyle={styles.scrollContent}
>
<Typography testID='screen-top' style={styles.architecture}>
contentContainerStyle={styles.scrollContent}
>
<Typography testID='screen-top' style={styles.architecture}>
Current Architecture: {IS_FABRIC ? 'Fabric 🚀' : 'Paper ✈️'}
</Typography>

<View style={styles.casesContainer}>
{demoCases.map(({ title, description, id }) => (
{demoCases.map(({ title, description, id }) => (
<ScenarioCard
key={id}
Expand Down
6 changes: 4 additions & 2 deletions ios/Library/RNTModalMountingHelper/RNTModalMountingHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ - (void)mount {
}

- (void)unmount {
[self.modal dismiss];
UIWindow *window = modalWindow;
[self.modal dismissWithCompletion:^{
window.hidden = YES;
}];
self.modal = nil;
self.isMounted = NO;
self.hasProps = NO;
self.hasChildren = NO;
modalWindow.hidden = YES;
modalWindow = nil;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@protocol RNTModalViewControllerProtocol <NSObject>
- (void)presentOn:(UIViewController *)parentVC onView:(UIView *)parentView;
- (void)dismiss;
- (void)dismissWithCompletion:(void (^ _Nullable)(void))completion;
- (void)addReactSubview:(UIView *)view;
- (void)setupReactSubview:(UIView *)subview;
- (void)setAnimationType:(NSString *)type;
Expand Down
8 changes: 7 additions & 1 deletion ios/Library/RNTModalViewController/RNTModalViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ - (void)presentOn:(UIViewController *)parentVC onView:(UIView *)parentView {
[self didMoveToParentViewController:parentVC];
}

- (void)dismiss {
- (void)dismissWithCompletion:(void (^ _Nullable)(void))completion {
UIView *prevReactSubviewContainer = self.reactSubviewContainer;
UIView *snapshot = [self.reactSubviewContainer snapshotViewAfterScreenUpdates:NO];

Expand All @@ -81,11 +81,17 @@ - (void)dismiss {
[self willMoveToParentViewController:nil];
[self.view removeFromSuperview];
[self removeFromParentViewController];
if (completion) {
completion();
}
}];
} else {
[self willMoveToParentViewController:nil];
[self.view removeFromSuperview];
[self removeFromParentViewController];
if (completion) {
completion();
}
}
}

Expand Down