mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 13:44:04 +00:00
[ReactNative] s/ReactNavigator/Navigator/
This commit is contained in:
parent
20501b3042
commit
558b8c65e0
@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
var BreadcrumbNavigationBar = require('BreadcrumbNavigationBar');
|
||||
var ReactNavigator = require('ReactNavigator');
|
||||
var Navigator = require('Navigator');
|
||||
var React = require('React');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
var ScrollView = require('ScrollView');
|
||||
@ -185,7 +185,7 @@ var BreadcrumbNavSample = React.createClass({
|
||||
onPress={this.onTabSelect.bind(this, 0)}
|
||||
icon={require('image!madman_tabnav_list')}
|
||||
title="One">
|
||||
<ReactNavigator
|
||||
<Navigator
|
||||
debugOverlay={false}
|
||||
style={[styles.appContainer]}
|
||||
initialRoute={initialRoute}
|
||||
@ -202,8 +202,8 @@ var BreadcrumbNavSample = React.createClass({
|
||||
onPress={this.onTabSelect.bind(this, 1)}
|
||||
icon={require('image!madman_tabnav_create')}
|
||||
title="Two">
|
||||
<ReactNavigator
|
||||
configureScene={() => ReactNavigator.SceneConfigs.FloatFromBottom}
|
||||
<Navigator
|
||||
configureScene={() => Navigator.SceneConfigs.FloatFromBottom}
|
||||
debugOverlay={false}
|
||||
style={[styles.appContainer]}
|
||||
initialRoute={initialRoute}
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var ReactNavigator = require('ReactNavigator');
|
||||
var Navigator = require('Navigator');
|
||||
var React = require('React');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
var ScrollView = require('ScrollView');
|
||||
@ -132,7 +132,7 @@ var JumpingNavSample = React.createClass({
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<ReactNavigator
|
||||
<Navigator
|
||||
debugOverlay={false}
|
||||
style={[styles.appContainer]}
|
||||
initialRoute={INIT_ROUTE}
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var ReactNavigator = require('ReactNavigator');
|
||||
var Navigator = require('Navigator');
|
||||
var NavigationBar = require('NavigationBar');
|
||||
var React = require('React');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
@ -70,7 +70,7 @@ var NavigationBarSample = React.createClass({
|
||||
render: function() {
|
||||
return (
|
||||
<View style={styles.appContainer}>
|
||||
<ReactNavigator
|
||||
<Navigator
|
||||
debugOverlay={false}
|
||||
style={styles.appContainer}
|
||||
initialRoute={newRandomRoute()}
|
@ -4,7 +4,7 @@
|
||||
'use strict';
|
||||
|
||||
var React = require('React');
|
||||
var ReactNavigator = require('ReactNavigator');
|
||||
var Navigator = require('Navigator');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
var Text = require('Text');
|
||||
var ScrollView = require('ScrollView');
|
||||
@ -35,7 +35,7 @@ class NavMenu extends React.Component {
|
||||
<TouchableHighlight style={styles.button} onPress={() => {
|
||||
this.props.onExampleExit();
|
||||
}}>
|
||||
<Text style={styles.buttonText}>Exit ReactNavigator Example</Text>
|
||||
<Text style={styles.buttonText}>Exit Navigator Example</Text>
|
||||
</TouchableHighlight>
|
||||
</ScrollView>
|
||||
);
|
||||
@ -45,7 +45,7 @@ class NavMenu extends React.Component {
|
||||
var TabBarExample = React.createClass({
|
||||
|
||||
statics: {
|
||||
title: '<ReactNavigator>',
|
||||
title: '<Navigator>',
|
||||
description: 'JS-implemented navigation',
|
||||
},
|
||||
|
||||
@ -69,11 +69,11 @@ var TabBarExample = React.createClass({
|
||||
|
||||
render: function() {
|
||||
return (
|
||||
<ReactNavigator
|
||||
<Navigator
|
||||
style={styles.container}
|
||||
initialRoute={{ id: 'menu', }}
|
||||
renderScene={this.renderScene}
|
||||
configureScene={(route) => ReactNavigator.SceneConfigs.FloatFromBottom}
|
||||
configureScene={(route) => Navigator.SceneConfigs.FloatFromBottom}
|
||||
/>
|
||||
);
|
||||
},
|
@ -6,7 +6,7 @@
|
||||
'use strict';
|
||||
|
||||
var BreadcrumbNavigationBar = require('BreadcrumbNavigationBar');
|
||||
var ReactNavigator = require('ReactNavigator');
|
||||
var Navigator = require('Navigator');
|
||||
var React = require('React');
|
||||
var ScrollView = require('ScrollView');
|
||||
var StyleSheet = require('StyleSheet');
|
||||
@ -90,7 +90,7 @@ var SecondDeepRouteMapper = (route, navigator) => (
|
||||
<Text style={styles.buttonText}>Push Horizontal</Text>
|
||||
</View>
|
||||
</TouchableBounce>
|
||||
<ReactNavigator
|
||||
<Navigator
|
||||
style={styles.thirdDeepNavigator}
|
||||
initialRoute={{title: '3x Nested Horizontal'}}
|
||||
renderScene={ThirdDeepRouteMapper}
|
||||
@ -111,7 +111,7 @@ var FirstDeepRouteMapper = (route, navigator) => (
|
||||
<Text style={styles.buttonText}>Push Outer Vertical Stack</Text>
|
||||
</View>
|
||||
</TouchableBounce>
|
||||
<ReactNavigator
|
||||
<Navigator
|
||||
style={styles.secondDeepNavigator}
|
||||
initialRoute={{title: '2x Nested Horizontal Nav'}}
|
||||
renderScene={SecondDeepRouteMapper}
|
||||
@ -132,9 +132,9 @@ var NestedBreadcrumbNavSample = React.createClass({
|
||||
var initialRoute = {title: 'Vertical'};
|
||||
// No navigation bar.
|
||||
return (
|
||||
<ReactNavigator
|
||||
<Navigator
|
||||
style={[styles.appContainer]}
|
||||
configureScene={() => ReactNavigator.SceneConfigs.FloatFromBottom}
|
||||
configureScene={() => Navigator.SceneConfigs.FloatFromBottom}
|
||||
initialRoute={initialRoute}
|
||||
renderScene={FirstDeepRouteMapper}
|
||||
/>
|
@ -22,7 +22,7 @@ var {
|
||||
TouchableHighlight,
|
||||
View,
|
||||
} = React;
|
||||
var ReactNavigatorExample = require('./ReactNavigator/ReactNavigatorExample');
|
||||
var NavigatorExample = require('./Navigator/NavigatorExample');
|
||||
|
||||
var { TestModule } = React.addons;
|
||||
|
||||
@ -36,7 +36,7 @@ var COMPONENTS = [
|
||||
require('./ListViewSimpleExample'),
|
||||
require('./MapViewExample'),
|
||||
require('./NavigatorIOSExample'),
|
||||
ReactNavigatorExample,
|
||||
NavigatorExample,
|
||||
require('./PickerExample'),
|
||||
require('./ScrollViewExample'),
|
||||
require('./SliderIOSExample'),
|
||||
@ -176,9 +176,9 @@ class UIExplorerList extends React.Component {
|
||||
}
|
||||
|
||||
_onPressRow(example) {
|
||||
if (example === ReactNavigatorExample) {
|
||||
if (example === NavigatorExample) {
|
||||
this.props.onExternalExampleRequested(
|
||||
ReactNavigatorExample
|
||||
NavigatorExample
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ var TextInputState = {
|
||||
* noop if the text field was already focused
|
||||
*/
|
||||
focusTextInput: function(textFieldID: string) {
|
||||
if (this._currentlyFocusedID != textFieldID && textFieldID != null) {
|
||||
if (this._currentlyFocusedID !== textFieldID && textFieldID !== null) {
|
||||
this._currentlyFocusedID = textFieldID;
|
||||
RCTUIManager.focus(textFieldID);
|
||||
}
|
||||
@ -49,7 +49,7 @@ var TextInputState = {
|
||||
* noop if it wasn't focused
|
||||
*/
|
||||
blurTextInput: function(textFieldID: string) {
|
||||
if (this._currentlyFocusedID == textFieldID && textFieldID != null) {
|
||||
if (this._currentlyFocusedID === textFieldID && textFieldID !== null) {
|
||||
this._currentlyFocusedID = null;
|
||||
RCTUIManager.blur(textFieldID);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Copyright 2004-present Facebook. All Rights Reserved.
|
||||
*
|
||||
* @providesModule ReactNavigator
|
||||
* @providesModule Navigator
|
||||
*/
|
||||
|
||||
"use strict"
|
||||
@ -10,7 +10,7 @@ var AnimationsDebugModule = require('NativeModules').AnimationsDebugModule;
|
||||
var Backstack = require('Backstack');
|
||||
var Dimensions = require('Dimensions');
|
||||
var InteractionMixin = require('InteractionMixin');
|
||||
var ReactNavigatorSceneConfigs = require('ReactNavigatorSceneConfigs');
|
||||
var NavigatorSceneConfigs = require('NavigatorSceneConfigs');
|
||||
var PanResponder = require('PanResponder');
|
||||
var React = require('React');
|
||||
var StaticContainer = require('StaticContainer.react');
|
||||
@ -72,7 +72,7 @@ var styles = StyleSheet.create({
|
||||
}
|
||||
});
|
||||
|
||||
var ReactNavigator = React.createClass({
|
||||
var Navigator = React.createClass({
|
||||
|
||||
propTypes: {
|
||||
configureScene: PropTypes.func,
|
||||
@ -90,7 +90,7 @@ var ReactNavigator = React.createClass({
|
||||
onItemRef: PropTypes.func,
|
||||
// Define the component to use for the nav bar, which will get navState and navigator props
|
||||
navigationBar: PropTypes.node,
|
||||
// The navigator object from a parent ReactNavigator
|
||||
// The navigator object from a parent Navigator
|
||||
navigator: PropTypes.object,
|
||||
|
||||
/**
|
||||
@ -102,14 +102,14 @@ var ReactNavigator = React.createClass({
|
||||
},
|
||||
|
||||
statics: {
|
||||
SceneConfigs: ReactNavigatorSceneConfigs,
|
||||
SceneConfigs: NavigatorSceneConfigs,
|
||||
},
|
||||
|
||||
mixins: [TimerMixin, InteractionMixin, Subscribable.Mixin],
|
||||
|
||||
getDefaultProps: function() {
|
||||
return {
|
||||
configureScene: () => ReactNavigatorSceneConfigs.PushFromRight,
|
||||
configureScene: () => NavigatorSceneConfigs.PushFromRight,
|
||||
sceneStyle: styles.defaultSceneStyle,
|
||||
};
|
||||
},
|
||||
@ -128,7 +128,7 @@ var ReactNavigator = React.createClass({
|
||||
} else {
|
||||
invariant(
|
||||
routeStack.length >= 1,
|
||||
'ReactNavigator requires props.initialRoute or props.initialRouteStack.'
|
||||
'Navigator requires props.initialRoute or props.initialRouteStack.'
|
||||
);
|
||||
}
|
||||
return {
|
||||
@ -857,4 +857,4 @@ var ReactNavigator = React.createClass({
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = ReactNavigator;
|
||||
module.exports = Navigator;
|
@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Copyright 2004-present Facebook. All Rights Reserved.
|
||||
*
|
||||
* @providesModule ReactNavigatorSceneConfigs
|
||||
* @providesModule NavigatorSceneConfigs
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
@ -260,7 +260,7 @@ var BaseConfig = {
|
||||
interpolators: Interpolators.Horizontal,
|
||||
};
|
||||
|
||||
var ReactNavigatorSceneConfigs = {
|
||||
var NavigatorSceneConfigs = {
|
||||
PushFromRight: merge(BaseConfig, {
|
||||
// We will want to customize this soon
|
||||
}),
|
||||
@ -276,4 +276,4 @@ var ReactNavigatorSceneConfigs = {
|
||||
}),
|
||||
};
|
||||
|
||||
module.exports = ReactNavigatorSceneConfigs;
|
||||
module.exports = NavigatorSceneConfigs;
|
2
Libraries/react-native/react-native.js
vendored
2
Libraries/react-native/react-native.js
vendored
@ -26,7 +26,7 @@ var ReactNative = Object.assign(Object.create(require('React')), {
|
||||
MapView: require('MapView'),
|
||||
NavigatorIOS: require('NavigatorIOS'),
|
||||
PickerIOS: require('PickerIOS'),
|
||||
ReactNavigator: require('ReactNavigator'),
|
||||
Navigator: require('Navigator'),
|
||||
ScrollView: require('ScrollView'),
|
||||
SliderIOS: require('SliderIOS'),
|
||||
SwitchIOS: require('SwitchIOS'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user