|
@@ -24,6 +24,7 @@ class ModalScreen extends Component {
|
24
|
24
|
this.onClickDismissAllPreviousModals = this.onClickDismissAllPreviousModals.bind(this);
|
25
|
25
|
this.onClickDismissFirstInStack = this.onClickDismissFirstInStack.bind(this);
|
26
|
26
|
this.onClickDismissAllModals = this.onClickDismissAllModals.bind(this);
|
|
27
|
+ this.onClickPushScreen = this.onClickPushScreen.bind(this);
|
27
|
28
|
}
|
28
|
29
|
|
29
|
30
|
render() {
|
|
@@ -35,6 +36,7 @@ class ModalScreen extends Component {
|
35
|
36
|
<Button title="Dismiss Modal" testID={testIDs.DISMISS_MODAL_BUTTON} onPress={this.onClickDismissModal} />
|
36
|
37
|
<Button title="Dismiss Unknown Modal" testID={testIDs.DISMISS_UNKNOWN_MODAL_BUTTON} onPress={this.onClickDismissUnknownModal} />
|
37
|
38
|
<Button title="Dismiss All Modals" testID={testIDs.DISMISS_ALL_MODALS_BUTTON} onPress={this.onClickDismissAllModals} />
|
|
39
|
+ <Button title="Push screen" testID={testIDs.PUSH_BUTTON} onPress={this.onClickPushScreen} />
|
38
|
40
|
{this.getPreviousModalId() ? (<Button title="Dismiss Previous Modal" testID={testIDs.DISMISS_PREVIOUS_MODAL_BUTTON} onPress={this.onClickDismissPreviousModal} />) : undefined}
|
39
|
41
|
{this.props.previousModalIds ? (<Button title="Dismiss ALL Previous Modals" testID={testIDs.DISMISS_ALL_PREVIOUS_MODAL_BUTTON} onPress={this.onClickDismissAllPreviousModals} />) : undefined}
|
40
|
42
|
{this.props.previousModalIds ? (<Button title="Dismiss First In Stack" testID={testIDs.DISMISS_FIRST_MODAL_BUTTON} onPress={this.onClickDismissFirstInStack} />) : undefined}
|
|
@@ -79,6 +81,15 @@ class ModalScreen extends Component {
|
79
|
81
|
Navigation.dismissAllModals();
|
80
|
82
|
}
|
81
|
83
|
|
|
84
|
+ onClickPushScreen() {
|
|
85
|
+ Navigation.push(this.props.containerId, {
|
|
86
|
+ name: `navigation.playground.TextScreen`,
|
|
87
|
+ passProps: {
|
|
88
|
+ text: 'Pushed from modal'
|
|
89
|
+ }
|
|
90
|
+ });
|
|
91
|
+ }
|
|
92
|
+
|
82
|
93
|
getModalPosition() {
|
83
|
94
|
return (this.props.modalPosition || 1);
|
84
|
95
|
}
|