Skip to content

Commit 3d7acb2

Browse files
authored
Updated to deprecated nav component (#15)
1 parent f5bbcb9 commit 3d7acb2

10 files changed

Lines changed: 1435 additions & 42 deletions

.eslintrc

Lines changed: 39 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
{
22
"parser": "babel-eslint",
3-
43
"ecmaFeatures": {
54
"jsx": true
65
},
7-
86
"env": {
97
"es6": true,
108
"jasmine": true,
11-
"node": 1,
9+
"node": true,
1210
},
13-
1411
"plugins": [
1512
"react"
1613
],
17-
1814
"globals": {
1915
"__DEV__": true,
2016
"__dirname": false,
@@ -46,7 +42,6 @@
4642
"pit": false,
4743
"FormData": true,
4844
},
49-
5045
"rules": {
5146
"comma-dangle": 0,
5247
"no-cond-assign": 1,
@@ -73,7 +68,6 @@
7368
"use-isnan": 1,
7469
"valid-jsdoc": 0,
7570
"valid-typeof": 1,
76-
7771
"block-scoped-var": 0,
7872
"complexity": 0,
7973
"consistent-return": 0,
@@ -116,13 +110,10 @@
116110
"no-warning-comments": 0,
117111
"no-with": 1,
118112
"radix": 1,
119-
"semi-spacing": 1,
120113
"vars-on-top": 0,
121114
"wrap-iife": 0,
122115
"yoda": 1,
123-
124116
"strict": 0,
125-
126117
"no-catch-shadow": 1,
127118
"no-delete-var": 1,
128119
"no-label-var": 1,
@@ -131,7 +122,13 @@
131122
"no-undef": 2,
132123
"no-undefined": 0,
133124
"no-undef-init": 1,
134-
"no-unused-vars": [1, {"vars": "all", "args": "none"}],
125+
"no-unused-vars": [
126+
1,
127+
{
128+
"vars": "all",
129+
"args": "none"
130+
}
131+
],
135132
"no-use-before-define": 0,
136133
"handle-callback-err": 1,
137134
"no-mixed-requires": 1,
@@ -140,13 +137,15 @@
140137
"no-process-exit": 0,
141138
"no-restricted-modules": 1,
142139
"no-sync": 0,
143-
144140
"key-spacing": 0,
145141
"comma-spacing": 0,
146142
"no-multi-spaces": 0,
147143
"brace-style": 0,
148144
"camelcase": 0,
149-
"consistent-this": [1, "self"],
145+
"consistent-this": [
146+
1,
147+
"self"
148+
],
150149
"eol-last": 1,
151150
"func-names": 0,
152151
"func-style": 0,
@@ -157,11 +156,16 @@
157156
"no-lonely-if": 0,
158157
"no-new-object": 1,
159158
"no-spaced-func": 1,
159+
"semi-spacing": 1,
160160
"no-ternary": 0,
161161
"no-trailing-spaces": 1,
162162
"no-underscore-dangle": 0,
163163
"no-mixed-spaces-and-tabs": 1,
164-
"quotes": [1, "single", "avoid-escape"],
164+
"quotes": [
165+
1,
166+
"single",
167+
"avoid-escape"
168+
],
165169
"quote-props": 0,
166170
"semi": 0,
167171
"sort-vars": 0,
@@ -170,32 +174,46 @@
170174
"space-in-parens": 0,
171175
"space-infix-ops": 1,
172176
"space-return-throw-case": 1,
173-
"space-unary-ops": [1, { "words": true, "nonwords": false }],
177+
"space-unary-ops": [
178+
1,
179+
{
180+
"words": true,
181+
"nonwords": false
182+
}
183+
],
174184
"max-nested-callbacks": 0,
175185
"one-var": 0,
176186
"wrap-regex": 0,
177-
178187
"max-depth": 0,
179188
"max-len": 0,
180189
"max-params": 0,
181190
"max-statements": 0,
182191
"no-bitwise": 1,
183192
"no-plusplus": 0,
184-
185193
"react/display-name": 0,
186194
"react/jsx-boolean-value": 0,
187-
"react/jsx-quotes": [1, "single", "avoid-escape"],
195+
"react/jsx-quotes": [
196+
1,
197+
"single",
198+
"avoid-escape"
199+
],
188200
"react/jsx-no-undef": 1,
189201
"react/jsx-sort-props": 0,
190202
"react/jsx-uses-react": 0,
191203
"react/jsx-uses-vars": 1,
192-
"react/no-did-mount-set-state": [1, "allow-in-func"],
193-
"react/no-did-update-set-state": [1, "allow-in-func"],
204+
"react/no-did-mount-set-state": [
205+
1,
206+
"allow-in-func"
207+
],
208+
"react/no-did-update-set-state": [
209+
1,
210+
"allow-in-func"
211+
],
194212
"react/no-multi-comp": 0,
195213
"react/no-unknown-property": 0,
196214
"react/prop-types": 0,
197215
"react/react-in-jsx-scope": 0,
198216
"react/self-closing-comp": 1,
199217
"react/wrap-multilines": 0
200218
}
201-
}
219+
}

.flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-3]\\|1[0-9]\\|[0-9
9393
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
9494

9595
[version]
96-
0.23.0
96+
>=0.23.0

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
node_modules
33
index.ios.js
44
iOS
5+
.vscode/

jsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"allowSyntheticDefaultImports": true
5+
},
6+
"exclude": [
7+
"node_modules"
8+
]
9+
}

lib/NavBar.android.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/* @flow */
22

33
import React from 'react'
4-
import {
5-
Navigator,
6-
StyleSheet,
7-
} from 'react-native'
4+
import { StyleSheet } from 'react-native'
5+
import CustomComponents from 'react-native-deprecated-custom-components'
86

97
const stylesAndroid = StyleSheet.create({
108
navBar: {
@@ -22,7 +20,7 @@ class NavBar extends React.Component {
2220

2321
render () {
2422
return (
25-
<Navigator.NavigationBar
23+
<CustomComponents.Navigator.NavigationBar
2624
style={[stylesAndroid.navBar, this.props.style]}
2725
routeMapper={this.props.routeMapper}
2826
navState={this.props.navState}
@@ -34,7 +32,7 @@ class NavBar extends React.Component {
3432
}
3533

3634
NavBar.propTypes = {
37-
...Navigator.NavigationBar.propTypes,
35+
...CustomComponents.Navigator.NavigationBar.propTypes,
3836
}
3937

4038
export default NavBar

lib/NavBar.ios.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/* @flow */
22

33
import React from 'react'
4-
import { Navigator, StyleSheet, PixelRatio } from 'react-native'
4+
import { StyleSheet, PixelRatio } from 'react-native'
5+
import CustomComponents from 'react-native-deprecated-custom-components'
56

67
class NavBar extends React.Component {
78
updateProgress (progress, fromIndex, toIndex) {
@@ -10,7 +11,7 @@ class NavBar extends React.Component {
1011

1112
render () {
1213
return (
13-
<Navigator.NavigationBar
14+
<CustomComponents.Navigator.NavigationBar
1415
style={[styles.navBar, this.props.style]}
1516
routeMapper={this.props.routeMapper}
1617
navState={this.props.navState}
@@ -22,7 +23,7 @@ class NavBar extends React.Component {
2223
}
2324

2425
NavBar.propTypes = {
25-
...Navigator.NavigationBar.propTypes,
26+
...CustomComponents.Navigator.NavigationBar.propTypes,
2627
}
2728

2829
const styles = StyleSheet.create({

lib/NavigatorWrapper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
import React, { PropTypes } from 'react'
44
import {
55
View,
6-
Navigator,
76
BackAndroid,
87
Platform,
98
} from 'react-native'
109
import { defaultRouteMapper } from './RouteMapper'
1110
import NavBar from './NavBar'
11+
import CustomComponents from 'react-native-deprecated-custom-components'
1212

1313
class NavigatorWrapper extends React.Component {
1414
static isAndroid = Platform.OS !== 'ios';
@@ -75,11 +75,11 @@ class NavigatorWrapper extends React.Component {
7575
}
7676

7777
render () {
78-
const navAnimation = (NavigatorWrapper.isAndroid) ? Navigator.SceneConfigs.FadeAndroid : Navigator.SceneConfigs.PushFromRight
78+
const navAnimation = (NavigatorWrapper.isAndroid) ? CustomComponents.Navigator.SceneConfigs.FadeAndroid : CustomComponents.Navigator.SceneConfigs.PushFromRight
7979
const routeMapper = this.props.routeMapper || defaultRouteMapper()
8080
const NavigationBar = (this.props.hideNavBar) ? null : <NavBar routeMapper={routeMapper} style={this.props.navBarStyle} />
8181
return (
82-
<Navigator
82+
<CustomComponents.Navigator
8383
configureScene={(route, routeStack) => this.props.navigationBarAnimation || navAnimation}
8484
initialRoute={this.props.initialRoute}
8585
initialRouteStack={this.props.initialRouteStack}

lib/TopNavigatorWrapper.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* @flow */
22

33
import React, { PropTypes } from 'react'
4-
import { View, Navigator, Platform } from 'react-native'
4+
import { View, Platform } from 'react-native'
55
import NavigatorWrapper from './NavigatorWrapper'
66
import { defaultRouteMapper } from './RouteMapper'
7+
import CustomComponents from 'react-native-deprecated-custom-components'
78

89
class TopNavigatorWrapper extends React.Component {
910
static isAndroid = Platform.OS !== 'ios';
@@ -47,9 +48,9 @@ class TopNavigatorWrapper extends React.Component {
4748
}
4849

4950
render () {
50-
const modalAnimation = (TopNavigatorWrapper.isAndroid) ? Navigator.SceneConfigs.FloatFromBottomAndroid : Navigator.SceneConfigs.FloatFromBottom
51+
const modalAnimation = (TopNavigatorWrapper.isAndroid) ? CustomComponents.Navigator.SceneConfigs.FloatFromBottomAndroid : CustomComponents.Navigator.SceneConfigs.FloatFromBottom
5152
return (
52-
<Navigator
53+
<CustomComponents.Navigator
5354
ref='topNavigator'
5455
renderScene={(route, navigator) => (this._renderScene(route, navigator))}
5556
initialRoute={{id: 'mainComponent'}}

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@
2525
},
2626
"homepage": "https://github.com/APSL/react-native-navigator-wrapper#readme",
2727
"devDependencies": {
28-
"babel-eslint": "^4.1.4",
29-
"eslint": "^1.8.0",
30-
"eslint-plugin-react": "^3.7.1"
28+
"babel-eslint": "^7.2.3",
29+
"eslint": "^3.19.0",
30+
"eslint-plugin-react": "^6.10.3",
31+
"prettier": "^1.3.0"
3132
},
3233
"dependencies": {
33-
"react-native-vector-icons": "^2.0.0"
34+
"react-native-deprecated-custom-components": "^0.1.0",
35+
"react-native-vector-icons": "^4.0.1"
3436
}
35-
}
37+
}

0 commit comments

Comments
 (0)