Skip to content

Commit 8ebd8d5

Browse files
committed
Added support injecting extra ui component to the setting screen,
with ability to controll the 'refresh app' message as a prop
1 parent d0751da commit 8ebd8d5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

demo/src/screens/SettingsScreen.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ class SettingsScreen extends Component {
6262
}, 1000);
6363
};
6464

65+
shouldShowRefreshAppMessage = () => {
66+
const {showRefreshMessage} = this.state;
67+
const {showRefreshAppMessage} = this.props;
68+
return showRefreshMessage || showRefreshAppMessage;
69+
}
70+
6571
renderTitle(title, subtitle) {
6672
return (
6773
<View marginT-20>
@@ -111,10 +117,13 @@ class SettingsScreen extends Component {
111117
<Text text80 dark20>Force RTL</Text>
112118
</View>
113119
</View>
120+
121+
{extraSettingsUI?.()}
122+
114123
</View>
115124

116125
<Text text30 dark10>Settings</Text>
117-
<Toast visible={showRefreshMessage} position="bottom" message="Refresh the app!"/>
126+
<Toast visible={this.shouldShowRefreshAppMessage()} position="bottom" message="Refresh the app!"/>
118127
</View>
119128
);
120129
}

0 commit comments

Comments
 (0)