@@ -15,7 +15,8 @@ class MainScreen extends Component {
15
15
static propTypes = {
16
16
containerStyle : ViewPropTypes . style ,
17
17
renderItem : PropTypes . func ,
18
- pageStyle : ViewPropTypes . style
18
+ pageStyle : ViewPropTypes . style ,
19
+ showRefreshAppMessage : PropTypes . bool
19
20
} ;
20
21
21
22
static options ( ) {
@@ -33,23 +34,32 @@ class MainScreen extends Component {
33
34
} ;
34
35
}
35
36
37
+ settingsScreenName = 'unicorn.Settings' ;
38
+
36
39
constructor ( props ) {
37
40
super ( props ) ;
38
41
39
42
const data = props . navigationData || navigationData ;
40
43
const extraSettingsUI = props . extraSettingsUI ;
41
-
44
+ const showRefreshAppMessage = props . showRefreshAppMessage ;
45
+
42
46
this . state = {
43
47
currentPage : 0 ,
44
48
filteredNavigationData : data ,
45
- extraSettingsUI
49
+ extraSettingsUI,
50
+ showRefreshAppMessage
46
51
} ;
47
52
48
53
this . filterExplorerScreens = _ . throttle ( this . filterExplorerScreens , 300 ) ;
49
54
50
55
Navigation . events ( ) . bindComponent ( this ) ;
51
56
}
52
57
58
+ shouldComponentUpdate = ( nextProps , nextState ) => {
59
+ this . updateShowRefreshAppMessage ( nextProps . showRefreshAppMessage ) ;
60
+ return true ;
61
+ }
62
+
53
63
onSearchBoxBlur = ( ) => {
54
64
this . closeSearchBox ( ) ;
55
65
// this.filterExplorerScreens('');
@@ -65,16 +75,27 @@ class MainScreen extends Component {
65
75
66
76
if ( buttonId === 'uilib.settingsButton' ) {
67
77
this . pushScreen ( {
68
- name : 'unicorn.Settings' ,
69
- passProps : { navigationData : data , playground : this . props . playground , extraSettingsUI : this . state . extraSettingsUI }
78
+ name : this . settingsScreenName ,
79
+ passProps : { navigationData : data ,
80
+ playground : this . props . playground ,
81
+ extraSettingsUI : this . state . extraSettingsUI ,
82
+ showRefreshAppMessage : false
83
+ }
70
84
} ) ;
71
85
}
72
86
} ;
73
87
88
+ updateShowRefreshAppMessage = ( show ) => {
89
+ Navigation . updateProps ( MainScreen . settingsScreenName , {
90
+ showRefreshAppMessage : show
91
+ } ) ;
92
+ }
93
+
74
94
pushScreen = options => {
75
95
Navigation . push ( this . props . componentId , {
76
96
component : {
77
97
name : options . name || options . screen ,
98
+ id : this . settingsScreenName ,
78
99
passProps : options . passProps ,
79
100
options : {
80
101
topBar : {
0 commit comments