Browse Source

Add componentName in modalDismissed event. (#5846)

* [iOS] Added componentName to be passed to modalDismissedEvent

* Added componentName to the ModalDismissedEvent type.

* Updated the JS test.

* Updated the Playground Podfile.lock.

* Updated the doc.

* Fixed dismissedMultipleModals not having a name.

* Made componentName optional for ModalDismissedEvent.

* Initial Android implementation

* Revert Android e2e emulator name

* Revert iOS Podfile

* Podfile

* Setting OCMock to 3.4.3

* Fixed the documentation.

* Fixed requested changes

* Updated the doc.

* Now emitting componentName for dismissAllModals event.

* Retriggering build

* Revert

* Move all topBar.title options to topBarTitlePresenter (#5883)

Fix TopBar title animation. This commit changes how RNN handles title and subtitle.
Until now, RNN created a custom view for title and subtitle which interfered with the way the system animated the TopBar title.
With this commit the custom view is created only when both subtitle and title are declared, otherwise RNN uses the system behavior.

* make dotIndicator to respect visible value (#5884)

In Android dotIndicator with initial value of visible: false is not respected and the dot appears in any case.

Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>

* Update default value for fontsize in navigation title and subtitle (#5868)

Co-authored-by: Yogev Ben David <yogevbd@wix.com>

* v0.62 Support (#5795)

react native 0.62 Support

* Fix bottomTab merging options with default (#5885)

When updating bottomTab options with mergeOptions - default options were not taken into account and therefore were not applied to the newly created tabBarItem

* Update package.json version to 4.6.1 [ci skip]

* Update package.json version to 4.7.0 [ci skip]

* Fix external components layout

* Move selectTabOnPress prop to correct interface (#5894)

* Update changelog

* External components fixes (#5896)

* Fix external components layout

* Fix external component navigationItem options resolving

* f

* Update package.json version to 4.7.1 [ci skip]

* Official Gradle Wrapper Validation Action (#5901)

See: https://github.com/gradle/wrapper-validation-action

* temporarily disable workflows

* Support react-native-youtube (#5903)

react-native-youtubte is a popular library which wraps the native youtube library. The native lib attempts to detect if the player is hidden behind other views in order to prevent developers from playing videos in the background.
Since the overlay container was always attached to hierarchy, the library stopped playback as it mistakingly detected the player was used in the background.

This commit simply attaches the overlay container only when needed so as long as no overlays are displayed, the lib can be used.

* apply extendedLayoutIncludesOpaqueBars true on all viewControllers (#5906)

* Update package.json version to 4.8.0 [ci skip]

* Fix overlays touch interception on new iPads (#5908)

* Fix NPE when showing Overlay (#5909)

Co-authored-by: Yogev Ben David <yogevbd@wix.com>

* Update package.json version to 4.8.1 [ci skip]

* Update changelog

* Allow reset topBar.title.color when color isn't provided (#5910)

* Allow topBar.title.color reset when color isn't provided

* Reset to nil color

* Merge topBar options with default

* Fix topBar options merging

Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>

* Update package.json version to 4.8.2 [ci skip]

* Update package.json version to 4.8.3 [ci skip]

* Fix wallaby (#5917)

* Fix wallaby

* Add coverage on tsx files

* Update lib/src/commands/OptionsProcessor.test.ts

Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>

* Fix topBar options merging with default (#5918)

* Add missing function

* Update package.json version to 4.8.4 [ci skip]

* Update changelog

* v5 (#5931)

Merge v5 into master

Highlights of this release
* Easier installation
* autolink and reac-native link support
* Shared Element Transition - reimplemented from scratch and new API
* [iOS] showModal animation api parity
* [Android] Animation values are now declared in dp
* [iOS] deprecate topBar.drawBehind
* [Android] RNN is migrating to Kotlin

closes #5904

* Update package.json version to 5.0.0 [ci skip]

* Adapt installation guide to v5

* Update installation guide

Forgot to add Kotlin plugin

* Fix compilation issue when using react native 0.62

Fixes #5933

* Update package.json version to 5.0.1 [ci skip]

* Add deprecateDrawBehind option (#5934)

* Add deprecateDrawBehind option

* Apply draw behind options when deprecateDrawBehind equals false

Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>

* [v5][docs][showcases] starter kit (#5936)

Hey! I have updated RNN version to the latest one (5.0.1 by the time)
Hope someone will find it useful 🤩

* Add window.backgroundColor option (#5942)

* Update package.json version to 5.1.0 [ci skip]

* Fix crash when mergeOptions were called before stack view was created (#5945)

Co-authored-by: Yogev Ben David <yogevbd@wix.com>

* Apply extendedLayoutIncludesOpaqueBars true on all viewControllers

* Update package.json version to 5.1.1 [ci skip]

* Update Android alert

* Fix custom push animations (#5947)

Custom push animations broke after refactoring Shared Element Transition.
Fixes #5943

* Layout background color (#5946)

* Apply layout.backgroundColor on parent view controllers

* Add layout.componentBackgroundColor

* Remove drawBehind deprecation

* Update package.json version to 6.0.0 [ci skip]

* Update changelog

* Fix applying drawBehind through mergeOptions (#5951)

mergeOptions did not handle bottomTabs.drawBehind options properly - the ReactRootView wasn't remeasured.

* Update package.json version to 6.0.1 [ci skip]

* Add slide animation to playground app

* [iOS] Added componentName to be passed to modalDismissedEvent

* Added componentName to the ModalDismissedEvent type.

* Updated the JS test.

* Updated the Playground Podfile.lock.

* Updated the doc.

* Fixed dismissedMultipleModals not having a name.

* Made componentName optional for ModalDismissedEvent.

* Initial Android implementation

* Revert Android e2e emulator name

* Revert iOS Podfile

* Podfile

* Setting OCMock to 3.4.3

* Fixed the documentation.

* Fixed requested changes

* Updated the doc.

* Now emitting componentName for dismissAllModals event.

* Retriggering build

* Revert

* Fix dismissedMultipleModals componentName

* Undo OCMock hard version

* Updated Podfile

Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
Co-authored-by: Yogev Ben David <yogevbd@wix.com>
Co-authored-by: Ioannis Tsampoulatidis <tsampoulatidis@gmail.com>
Co-authored-by: Mary Jenel <myersjenel@gmail.com>
Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com>
Co-authored-by: wixmobile <41264282+wixmobile@users.noreply.github.com>
Co-authored-by: Roberto Tatasciore <tatasciorecont@gmail.com>
Co-authored-by: Jonathan Leitschuh <jonathan.leitschuh@gmail.com>
Co-authored-by: ʙ ᴀ ᴛ ʀ <kanzitdinov@gmail.com>
Jin Shin 4 years ago
parent
commit
1c2558d77e
No account linked to committer's email address
21 changed files with 92 additions and 18 deletions
  1. 29
    1
      docs/docs/events.md
  2. 2
    1
      lib/android/app/src/main/java/com/reactnativenavigation/react/events/EventEmitter.java
  3. 5
    0
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ComponentViewController.java
  4. 5
    0
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java
  5. 5
    0
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/TitleBarButtonController.java
  6. 5
    0
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/TitleBarReactViewController.java
  7. 1
    0
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ViewController.java
  8. 5
    0
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/externalcomponent/ExternalComponentViewController.java
  9. 3
    2
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalStack.java
  10. 5
    0
      lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/topbar/TopBarBackgroundViewController.java
  11. 1
    1
      lib/android/app/src/reactNative62/java/reactnativenavigation/react/NavigationReactNativeHost.java
  12. 5
    0
      lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleViewController.java
  13. 6
    0
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ViewControllerTest.java
  14. 1
    1
      lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalStackTest.java
  15. 3
    2
      lib/ios/RNNCommandsHandler.m
  16. 1
    1
      lib/ios/RNNEventEmitter.h
  17. 2
    1
      lib/ios/RNNEventEmitter.m
  18. 2
    2
      lib/src/events/ComponentEventsObserver.test.tsx
  19. 1
    1
      lib/src/interfaces/ComponentEvents.ts
  20. 1
    1
      playground/ios/NavigationTests/UIViewController+LayoutProtocolTest.m
  21. 4
    4
      playground/ios/Podfile.lock

+ 29
- 1
docs/docs/events.md View File

133
 |**completionTime**|Timestamp when the command, and consecutive animations, completed.|
133
 |**completionTime**|Timestamp when the command, and consecutive animations, completed.|
134
 
134
 
135
 ## registerModalDismissedListener
135
 ## registerModalDismissedListener
136
+
136
 Invoked when modal dismissed.
137
 Invoked when modal dismissed.
137
 
138
 
139
+```js
140
+class MyComponent extends Component {
141
+
142
+  componentDidMount() {
143
+    this.navigationEventListener = Navigation.events().bindComponent(this);
144
+  }
145
+
146
+  componentWillUnmount() {
147
+    // Not mandatory
148
+    if (this.navigationEventListener) {
149
+      this.navigationEventListener.remove();
150
+    }
151
+  }
152
+
153
+  modalDismissed({ componentId, componentName, modalsDismissed }) {
154
+
155
+  }
156
+}
157
+```
158
+
159
+This event can be observed globally as well:
160
+
138
 ```js
161
 ```js
139
 // Subscribe
162
 // Subscribe
140
-const modalDismissedListener = Navigation.events().registerModalDismissedListener(({ componentId, modalsDismissed }) => {
163
+const modalDismissedListener = Navigation.events().registerModalDismissedListener(({ componentId, componentName, modalsDismissed }) => {
141
 
164
 
142
 });
165
 });
143
 ...
166
 ...
144
 // Unsubscribe
167
 // Unsubscribe
145
 modalDismissedListener.remove();
168
 modalDismissedListener.remove();
146
 ```
169
 ```
170
+|       Parameter         | Description |
171
+|:--------------------:|:-----|
172
+|**componentId**| Id of the dismissing modal|
173
+|**componentName**|Registered name used when registering the component with `Navigation.registerComponent()`|
174
+|**modalsDismissed**|Number of modals dismissed.|
147
 
175
 
148
 ## registerModalAttemptedToDismissListener(iOS 13+ only)
176
 ## registerModalAttemptedToDismissListener(iOS 13+ only)
149
 Invoked only on iOS pageSheet modal when swipeToDismiss flag is set to true and modal swiped down to dismiss.
177
 Invoked only on iOS pageSheet modal when swipeToDismiss flag is set to true and modal swiped down to dismiss.

+ 2
- 1
lib/android/app/src/main/java/com/reactnativenavigation/react/events/EventEmitter.java View File

76
         emit(CommandCompleted, event);
76
         emit(CommandCompleted, event);
77
     }
77
     }
78
 
78
 
79
-    public void emitModalDismissed(String id, int modalsDismissed) {
79
+    public void emitModalDismissed(String id, String componentName, int modalsDismissed) {
80
         WritableMap event = Arguments.createMap();
80
         WritableMap event = Arguments.createMap();
81
         event.putString("componentId", id);
81
         event.putString("componentId", id);
82
+        event.putString("componentName", componentName);
82
         event.putInt("modalsDismissed", modalsDismissed);
83
         event.putInt("modalsDismissed", modalsDismissed);
83
         emit(ModalDismissed, event);
84
         emit(ModalDismissed, event);
84
     }
85
     }

+ 5
- 0
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ComponentViewController.java View File

40
         this.presenter = componentPresenter;
40
         this.presenter = componentPresenter;
41
     }
41
     }
42
 
42
 
43
+    @Override
44
+    public String getCurrentComponentName() {
45
+        return this.componentName;
46
+    }
47
+
43
     @Override
48
     @Override
44
     public void setDefaultOptions(Options defaultOptions) {
49
     public void setDefaultOptions(Options defaultOptions) {
45
         super.setDefaultOptions(defaultOptions);
50
         super.setDefaultOptions(defaultOptions);

+ 5
- 0
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java View File

171
     public int getBottomInset(ViewController child) {
171
     public int getBottomInset(ViewController child) {
172
         return perform(getParentController(), 0, p -> p.getBottomInset(child));
172
         return perform(getParentController(), 0, p -> p.getBottomInset(child));
173
     }
173
     }
174
+
175
+    @Override
176
+    public String getCurrentComponentName() {
177
+	    return getCurrentChild().getCurrentComponentName();
178
+    }
174
 }
179
 }

+ 5
- 0
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/TitleBarButtonController.java View File

88
         getView().sendOnNavigationButtonPressed(buttonId);
88
         getView().sendOnNavigationButtonPressed(buttonId);
89
     }
89
     }
90
 
90
 
91
+    @Override
92
+    public String getCurrentComponentName() {
93
+        return button.component.name.get();
94
+    }
95
+
91
     @NonNull
96
     @NonNull
92
     @Override
97
     @Override
93
     protected TitleBarReactButtonView createView() {
98
     protected TitleBarReactButtonView createView() {

+ 5
- 0
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/TitleBarReactViewController.java View File

45
 
45
 
46
     }
46
     }
47
 
47
 
48
+    @Override
49
+    public String getCurrentComponentName() {
50
+        return null;
51
+    }
52
+
48
     public void setComponent(Component component) {
53
     public void setComponent(Component component) {
49
         this.component = component;
54
         this.component = component;
50
     }
55
     }

+ 1
- 0
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ViewController.java View File

69
     private ViewVisibilityListener viewVisibilityListener = new ViewVisibilityListenerAdapter();
69
     private ViewVisibilityListener viewVisibilityListener = new ViewVisibilityListenerAdapter();
70
     protected FabPresenter fabOptionsPresenter;
70
     protected FabPresenter fabOptionsPresenter;
71
     private ViewControllerOverlay overlay;
71
     private ViewControllerOverlay overlay;
72
+    @Nullable public abstract String getCurrentComponentName();
72
 
73
 
73
     public boolean isDestroyed() {
74
     public boolean isDestroyed() {
74
         return isDestroyed;
75
         return isDestroyed;

+ 5
- 0
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/externalcomponent/ExternalComponentViewController.java View File

88
         if (view != null) presenter.applyBottomInset(view, getBottomInset());
88
         if (view != null) presenter.applyBottomInset(view, getBottomInset());
89
     }
89
     }
90
 
90
 
91
+    @Override
92
+    public String getCurrentComponentName() {
93
+        return externalComponent.name.get();
94
+    }
95
+
91
     public FragmentActivity getActivity() {
96
     public FragmentActivity getActivity() {
92
         return (FragmentActivity) super.getActivity();
97
         return (FragmentActivity) super.getActivity();
93
     }
98
     }

+ 3
- 2
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/modal/ModalStack.java View File

64
             CommandListenerAdapter onDismiss = new CommandListenerAdapter(listener) {
64
             CommandListenerAdapter onDismiss = new CommandListenerAdapter(listener) {
65
                 @Override
65
                 @Override
66
                 public void onSuccess(String childId) {
66
                 public void onSuccess(String childId) {
67
-                    eventEmitter.emitModalDismissed(componentId, 1);
67
+                    eventEmitter.emitModalDismissed(componentId, toDismiss.getCurrentComponentName(), 1);
68
                     super.onSuccess(componentId);
68
                     super.onSuccess(componentId);
69
                 }
69
                 }
70
             };
70
             };
89
         }
89
         }
90
 
90
 
91
         String topModalId = peek().getId();
91
         String topModalId = peek().getId();
92
+        String topModalName = peek().getCurrentComponentName();
92
         int modalsDismissed = size();
93
         int modalsDismissed = size();
93
 
94
 
94
         peek().mergeOptions(mergeOptions);
95
         peek().mergeOptions(mergeOptions);
98
                 dismissModal(modals.get(0).getId(), root, new CommandListenerAdapter(listener) {
99
                 dismissModal(modals.get(0).getId(), root, new CommandListenerAdapter(listener) {
99
                     @Override
100
                     @Override
100
                     public void onSuccess(String childId) {
101
                     public void onSuccess(String childId) {
101
-                        eventEmitter.emitModalDismissed(topModalId, modalsDismissed);
102
+                        eventEmitter.emitModalDismissed(topModalId, topModalName, modalsDismissed);
102
                         super.onSuccess(childId);
103
                         super.onSuccess(childId);
103
                     }
104
                     }
104
                 });
105
                 });

+ 5
- 0
lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/topbar/TopBarBackgroundViewController.java View File

44
 
44
 
45
     }
45
     }
46
 
46
 
47
+    @Override
48
+    public String getCurrentComponentName() {
49
+        return component.name.get();
50
+    }
51
+
47
     public void setComponent(Component component) {
52
     public void setComponent(Component component) {
48
         this.component = component;
53
         this.component = component;
49
     }
54
     }

+ 1
- 1
lib/android/app/src/reactNative62/java/reactnativenavigation/react/NavigationReactNativeHost.java View File

64
     protected DevBundleDownloadListener getDevBundleDownloadListener() {
64
     protected DevBundleDownloadListener getDevBundleDownloadListener() {
65
         return bundleListenerMediator;
65
         return bundleListenerMediator;
66
     }
66
     }
67
-}
67
+}

+ 5
- 0
lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleViewController.java View File

64
         if (view != null) presenter.applyBottomInset(view, getBottomInset());
64
         if (view != null) presenter.applyBottomInset(view, getBottomInset());
65
     }
65
     }
66
 
66
 
67
+    @Override
68
+    public String getCurrentComponentName() {
69
+        return null;
70
+    }
71
+
67
     public static class SimpleView extends ReactView implements ReactComponent {
72
     public static class SimpleView extends ReactView implements ReactComponent {
68
 
73
 
69
         public SimpleView(@NonNull Context context) {
74
         public SimpleView(@NonNull Context context) {

+ 6
- 0
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/ViewControllerTest.java View File

75
             public void sendOnNavigationButtonPressed(String buttonId) {
75
             public void sendOnNavigationButtonPressed(String buttonId) {
76
 
76
 
77
             }
77
             }
78
+
79
+            @Override
80
+            public String getCurrentComponentName() { return null; }
78
         };
81
         };
79
         assertThat(myController.getView()).isEqualTo(otherView);
82
         assertThat(myController.getView()).isEqualTo(otherView);
80
     }
83
     }
146
             public void sendOnNavigationButtonPressed(String buttonId) {
149
             public void sendOnNavigationButtonPressed(String buttonId) {
147
 
150
 
148
             }
151
             }
152
+
153
+            @Override
154
+            public String getCurrentComponentName() { return null; }
149
         };
155
         };
150
         vc.onChildViewAdded(view, child);
156
         vc.onChildViewAdded(view, child);
151
         verify(yellowBoxDelegate).onChildViewAdded(view, child);
157
         verify(yellowBoxDelegate).onChildViewAdded(view, child);

+ 1
- 1
lib/android/app/src/test/java/com/reactnativenavigation/viewcontrollers/modal/ModalStackTest.java View File

116
         CommandListener listener = spy(new CommandListenerAdapter());
116
         CommandListener listener = spy(new CommandListenerAdapter());
117
         uut.dismissModal(modal4.getId(), root, listener);
117
         uut.dismissModal(modal4.getId(), root, listener);
118
         verify(listener).onSuccess(modal4.getId());
118
         verify(listener).onSuccess(modal4.getId());
119
-        verify(emitter).emitModalDismissed(modal4.getId(), 1);
119
+        verify(emitter).emitModalDismissed(modal4.getId(), modal4.getCurrentComponentName(), 1);
120
     }
120
     }
121
 
121
 
122
     @SuppressWarnings("Convert2Lambda")
122
     @SuppressWarnings("Convert2Lambda")

+ 3
- 2
lib/ios/RNNCommandsHandler.m View File

352
 #pragma mark - RNNModalManagerDelegate
352
 #pragma mark - RNNModalManagerDelegate
353
 
353
 
354
 - (void)dismissedModal:(UIViewController *)viewController {
354
 - (void)dismissedModal:(UIViewController *)viewController {
355
-	[_eventEmitter sendModalsDismissedEvent:viewController.layoutInfo.componentId numberOfModalsDismissed:@(1)];
355
+	[_eventEmitter sendModalsDismissedEvent:viewController.layoutInfo.componentId componentName:viewController.layoutInfo.name numberOfModalsDismissed:@(1)];
356
 }
356
 }
357
 
357
 
358
 - (void)attemptedToDismissModal:(UIViewController *)viewController {
358
 - (void)attemptedToDismissModal:(UIViewController *)viewController {
361
 
361
 
362
 - (void)dismissedMultipleModals:(NSArray *)viewControllers {
362
 - (void)dismissedMultipleModals:(NSArray *)viewControllers {
363
 	if (viewControllers && viewControllers.count) {
363
 	if (viewControllers && viewControllers.count) {
364
-		[_eventEmitter sendModalsDismissedEvent:((UIViewController *)viewControllers.lastObject).layoutInfo.componentId numberOfModalsDismissed:@(viewControllers.count)];
364
+		UIViewController* lastViewController = [viewControllers.lastObject presentedComponentViewController];
365
+        [_eventEmitter sendModalsDismissedEvent:lastViewController.layoutInfo.componentId componentName:lastViewController.layoutInfo.name numberOfModalsDismissed:@(viewControllers.count)];
365
 	}
366
 	}
366
 }
367
 }
367
 
368
 

+ 1
- 1
lib/ios/RNNEventEmitter.h View File

24
 
24
 
25
 - (void)sendOnPreviewCompleted:(NSString *)componentId previewComponentId:(NSString *)previewComponentId;
25
 - (void)sendOnPreviewCompleted:(NSString *)componentId previewComponentId:(NSString *)previewComponentId;
26
 
26
 
27
-- (void)sendModalsDismissedEvent:(NSString *)componentId numberOfModalsDismissed:(NSNumber *)modalsDismissed;
27
+- (void)sendModalsDismissedEvent:(NSString *)componentId componentName:(NSString *)componentName numberOfModalsDismissed:(NSNumber *)modalsDismissed;
28
 
28
 
29
 - (void)sendModalAttemptedToDismissEvent:(NSString *)componentId;
29
 - (void)sendModalAttemptedToDismissEvent:(NSString *)componentId;
30
 
30
 

+ 2
- 1
lib/ios/RNNEventEmitter.m View File

124
     }];
124
     }];
125
 }
125
 }
126
 
126
 
127
-- (void)sendModalsDismissedEvent:(NSString *)componentId numberOfModalsDismissed:(NSNumber *)modalsDismissed {
127
+- (void)sendModalsDismissedEvent:(NSString *)componentId componentName:(NSString *)componentName numberOfModalsDismissed:(NSNumber *)modalsDismissed {
128
     [self send:ModalDismissed body:@{
128
     [self send:ModalDismissed body:@{
129
         @"componentId": componentId,
129
         @"componentId": componentId,
130
+        @"componentName": componentName,
130
         @"modalsDismissed": modalsDismissed
131
         @"modalsDismissed": modalsDismissed
131
     }];
132
     }];
132
 }
133
 }

+ 2
- 2
lib/src/events/ComponentEventsObserver.test.tsx View File

193
     expect(navigationButtonPressedFn).toHaveBeenCalledTimes(1);
193
     expect(navigationButtonPressedFn).toHaveBeenCalledTimes(1);
194
     expect(navigationButtonPressedFn).toHaveBeenCalledWith({ buttonId: 'myButtonId', componentId: 'myCompId' });
194
     expect(navigationButtonPressedFn).toHaveBeenCalledWith({ buttonId: 'myButtonId', componentId: 'myCompId' });
195
 
195
 
196
-    uut.notifyModalDismissed({ componentId: 'myCompId', modalsDismissed: 1 });
196
+    uut.notifyModalDismissed({ componentId: 'myCompId', componentName: 'myCompName', modalsDismissed: 1 });
197
     expect(modalDismissedFn).toHaveBeenCalledTimes(1);
197
     expect(modalDismissedFn).toHaveBeenCalledTimes(1);
198
-    expect(modalDismissedFn).toHaveBeenLastCalledWith({ componentId: 'myCompId', modalsDismissed: 1 })
198
+    expect(modalDismissedFn).toHaveBeenLastCalledWith({ componentId: 'myCompId', componentName: 'myCompName', modalsDismissed: 1 })
199
 
199
 
200
     uut.notifyModalAttemptedToDismiss({ componentId: 'myCompId' });
200
     uut.notifyModalAttemptedToDismiss({ componentId: 'myCompId' });
201
     expect(modalAttemptedToDismissFn).toHaveBeenCalledTimes(1);
201
     expect(modalAttemptedToDismissFn).toHaveBeenCalledTimes(1);

+ 1
- 1
lib/src/interfaces/ComponentEvents.ts View File

20
 }
20
 }
21
 
21
 
22
 export interface ModalDismissedEvent extends ComponentEvent {
22
 export interface ModalDismissedEvent extends ComponentEvent {
23
-  componentId: string;
23
+  componentName: string;
24
   modalsDismissed: number;
24
   modalsDismissed: number;
25
 }
25
 }
26
 
26
 

+ 1
- 1
playground/ios/NavigationTests/UIViewController+LayoutProtocolTest.m View File

112
 	UIViewController* component = [[UIViewController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:nil];
112
 	UIViewController* component = [[UIViewController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:nil];
113
 	UINavigationController* stack = [[UINavigationController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:nil];
113
 	UINavigationController* stack = [[UINavigationController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:nil];
114
 	UITabBarController* tabBar = [[UITabBarController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:nil];
114
 	UITabBarController* tabBar = [[UITabBarController alloc] initWithLayoutInfo:nil creator:nil options:[[RNNNavigationOptions alloc] initEmptyOptions] defaultOptions:nil presenter:nil eventEmitter:nil childViewControllers:nil];
115
-
115
+	
116
 	XCTAssertTrue(component.extendedLayoutIncludesOpaqueBars);
116
 	XCTAssertTrue(component.extendedLayoutIncludesOpaqueBars);
117
 	XCTAssertTrue(stack.extendedLayoutIncludesOpaqueBars);
117
 	XCTAssertTrue(stack.extendedLayoutIncludesOpaqueBars);
118
 	XCTAssertTrue(tabBar.extendedLayoutIncludesOpaqueBars);
118
 	XCTAssertTrue(tabBar.extendedLayoutIncludesOpaqueBars);

+ 4
- 4
playground/ios/Podfile.lock View File

220
     - ReactCommon/jscallinvoker (= 0.61.5)
220
     - ReactCommon/jscallinvoker (= 0.61.5)
221
   - ReactNativeKeyboardTrackingView (5.6.1):
221
   - ReactNativeKeyboardTrackingView (5.6.1):
222
     - React
222
     - React
223
-  - ReactNativeNavigation (5.0.0-alpha.14):
223
+  - ReactNativeNavigation (6.0.1):
224
     - React
224
     - React
225
     - React-RCTImage
225
     - React-RCTImage
226
     - React-RCTText
226
     - React-RCTText
260
   - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`)
260
   - Yoga (from `../../node_modules/react-native/ReactCommon/yoga`)
261
 
261
 
262
 SPEC REPOS:
262
 SPEC REPOS:
263
-  https://github.com/cocoapods/specs.git:
263
+  trunk:
264
     - boost-for-react-native
264
     - boost-for-react-native
265
     - OCMock
265
     - OCMock
266
 
266
 
348
   React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
348
   React-RCTVibration: a49a1f42bf8f5acf1c3e297097517c6b3af377ad
349
   ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
349
   ReactCommon: 198c7c8d3591f975e5431bec1b0b3b581aa1c5dd
350
   ReactNativeKeyboardTrackingView: a240a6a0dba852bb107109a7ec7e98b884055977
350
   ReactNativeKeyboardTrackingView: a240a6a0dba852bb107109a7ec7e98b884055977
351
-  ReactNativeNavigation: c14fd9c2ffd0ceb418065b97709c0497f38f9dcd
351
+  ReactNativeNavigation: 33657becf06c9c3a805ecb50dce8010fb887a1bb
352
   Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
352
   Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b
353
 
353
 
354
 PODFILE CHECKSUM: 781f49751a12b13af3e83d5dfc4b122aa5770543
354
 PODFILE CHECKSUM: 781f49751a12b13af3e83d5dfc4b122aa5770543
355
 
355
 
356
-COCOAPODS: 1.7.5
356
+COCOAPODS: 1.8.4