2015-04-23 13:22:16 +00:00
|
|
|
/**
|
2017-05-06 03:50:47 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
2016-07-12 12:51:57 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-07-12 12:51:57 +00:00
|
|
|
*
|
2018-05-11 20:32:37 +00:00
|
|
|
* @format
|
2017-02-25 11:05:32 +00:00
|
|
|
*/
|
2018-05-11 20:32:37 +00:00
|
|
|
|
2015-04-23 13:22:16 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-04-09 03:36:40 +00:00
|
|
|
var React = require('react');
|
|
|
|
var ReactNative = require('react-native');
|
2018-05-11 20:32:37 +00:00
|
|
|
var {NavigatorIOS, StatusBar, StyleSheet, Text, View} = ReactNative;
|
2015-04-23 13:22:16 +00:00
|
|
|
|
2016-07-26 08:00:02 +00:00
|
|
|
class EmptyPage extends React.Component {
|
|
|
|
render() {
|
2015-04-23 13:22:16 +00:00
|
|
|
return (
|
|
|
|
<View style={styles.emptyPage}>
|
2018-05-11 20:32:37 +00:00
|
|
|
<Text style={styles.emptyPageText}>{this.props.text}</Text>
|
2015-04-23 13:22:16 +00:00
|
|
|
</View>
|
|
|
|
);
|
2016-07-26 08:00:02 +00:00
|
|
|
}
|
|
|
|
}
|
2015-04-23 13:22:16 +00:00
|
|
|
|
2016-07-26 08:00:02 +00:00
|
|
|
class NavigatorIOSColors extends React.Component {
|
2017-08-25 07:03:17 +00:00
|
|
|
static title = '<NavigatorIOS> - Custom Colors';
|
2016-07-26 08:00:02 +00:00
|
|
|
static description = 'iOS navigation with custom nav bar colors';
|
2015-04-23 13:22:16 +00:00
|
|
|
|
2016-07-26 08:00:02 +00:00
|
|
|
render() {
|
2015-04-23 13:22:16 +00:00
|
|
|
// Set StatusBar with light contents to get better contrast
|
2016-02-22 16:27:18 +00:00
|
|
|
StatusBar.setBarStyle('light-content');
|
2015-04-23 13:22:16 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<NavigatorIOS
|
|
|
|
style={styles.container}
|
|
|
|
initialRoute={{
|
|
|
|
component: EmptyPage,
|
|
|
|
title: '<NavigatorIOS>',
|
|
|
|
rightButtonTitle: 'Done',
|
|
|
|
onRightButtonPress: () => {
|
2016-02-22 16:27:18 +00:00
|
|
|
StatusBar.setBarStyle('default');
|
2015-04-23 13:22:16 +00:00
|
|
|
this.props.onExampleExit();
|
|
|
|
},
|
|
|
|
passProps: {
|
2018-05-11 20:32:37 +00:00
|
|
|
text:
|
|
|
|
'The nav bar has custom colors with tintColor, ' +
|
2015-04-23 13:22:16 +00:00
|
|
|
'barTintColor and titleTextColor props.',
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
tintColor="#FFFFFF"
|
|
|
|
barTintColor="#183E63"
|
|
|
|
titleTextColor="#FFFFFF"
|
2015-10-01 00:17:43 +00:00
|
|
|
translucent={true}
|
2015-04-23 13:22:16 +00:00
|
|
|
/>
|
|
|
|
);
|
2016-07-26 08:00:02 +00:00
|
|
|
}
|
|
|
|
}
|
2015-04-23 13:22:16 +00:00
|
|
|
|
|
|
|
var styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
},
|
|
|
|
emptyPage: {
|
|
|
|
flex: 1,
|
|
|
|
paddingTop: 64,
|
|
|
|
},
|
|
|
|
emptyPageText: {
|
|
|
|
margin: 10,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
NavigatorIOSColors.external = true;
|
|
|
|
|
|
|
|
module.exports = NavigatorIOSColors;
|