Skip to content

Commit

Permalink
Updated to deprecated nav component (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaromb authored May 3, 2017
1 parent f5bbcb9 commit 3d7acb2
Show file tree
Hide file tree
Showing 10 changed files with 1,435 additions and 42 deletions.
60 changes: 39 additions & 21 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
{
"parser": "babel-eslint",

"ecmaFeatures": {
"jsx": true
},

"env": {
"es6": true,
"jasmine": true,
"node": 1,
"node": true,
},

"plugins": [
"react"
],

"globals": {
"__DEV__": true,
"__dirname": false,
Expand Down Expand Up @@ -46,7 +42,6 @@
"pit": false,
"FormData": true,
},

"rules": {
"comma-dangle": 0,
"no-cond-assign": 1,
Expand All @@ -73,7 +68,6 @@
"use-isnan": 1,
"valid-jsdoc": 0,
"valid-typeof": 1,

"block-scoped-var": 0,
"complexity": 0,
"consistent-return": 0,
Expand Down Expand Up @@ -116,13 +110,10 @@
"no-warning-comments": 0,
"no-with": 1,
"radix": 1,
"semi-spacing": 1,
"vars-on-top": 0,
"wrap-iife": 0,
"yoda": 1,

"strict": 0,

"no-catch-shadow": 1,
"no-delete-var": 1,
"no-label-var": 1,
Expand All @@ -131,7 +122,13 @@
"no-undef": 2,
"no-undefined": 0,
"no-undef-init": 1,
"no-unused-vars": [1, {"vars": "all", "args": "none"}],
"no-unused-vars": [
1,
{
"vars": "all",
"args": "none"
}
],
"no-use-before-define": 0,
"handle-callback-err": 1,
"no-mixed-requires": 1,
Expand All @@ -140,13 +137,15 @@
"no-process-exit": 0,
"no-restricted-modules": 1,
"no-sync": 0,

"key-spacing": 0,
"comma-spacing": 0,
"no-multi-spaces": 0,
"brace-style": 0,
"camelcase": 0,
"consistent-this": [1, "self"],
"consistent-this": [
1,
"self"
],
"eol-last": 1,
"func-names": 0,
"func-style": 0,
Expand All @@ -157,11 +156,16 @@
"no-lonely-if": 0,
"no-new-object": 1,
"no-spaced-func": 1,
"semi-spacing": 1,
"no-ternary": 0,
"no-trailing-spaces": 1,
"no-underscore-dangle": 0,
"no-mixed-spaces-and-tabs": 1,
"quotes": [1, "single", "avoid-escape"],
"quotes": [
1,
"single",
"avoid-escape"
],
"quote-props": 0,
"semi": 0,
"sort-vars": 0,
Expand All @@ -170,32 +174,46 @@
"space-in-parens": 0,
"space-infix-ops": 1,
"space-return-throw-case": 1,
"space-unary-ops": [1, { "words": true, "nonwords": false }],
"space-unary-ops": [
1,
{
"words": true,
"nonwords": false
}
],
"max-nested-callbacks": 0,
"one-var": 0,
"wrap-regex": 0,

"max-depth": 0,
"max-len": 0,
"max-params": 0,
"max-statements": 0,
"no-bitwise": 1,
"no-plusplus": 0,

"react/display-name": 0,
"react/jsx-boolean-value": 0,
"react/jsx-quotes": [1, "single", "avoid-escape"],
"react/jsx-quotes": [
1,
"single",
"avoid-escape"
],
"react/jsx-no-undef": 1,
"react/jsx-sort-props": 0,
"react/jsx-uses-react": 0,
"react/jsx-uses-vars": 1,
"react/no-did-mount-set-state": [1, "allow-in-func"],
"react/no-did-update-set-state": [1, "allow-in-func"],
"react/no-did-mount-set-state": [
1,
"allow-in-func"
],
"react/no-did-update-set-state": [
1,
"allow-in-func"
],
"react/no-multi-comp": 0,
"react/no-unknown-property": 0,
"react/prop-types": 0,
"react/react-in-jsx-scope": 0,
"react/self-closing-comp": 1,
"react/wrap-multilines": 0
}
}
}
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-3]\\|1[0-9]\\|[0-9
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy

[version]
0.23.0
>=0.23.0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
node_modules
index.ios.js
iOS
.vscode/
9 changes: 9 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
]
}
10 changes: 4 additions & 6 deletions lib/NavBar.android.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/* @flow */

import React from 'react'
import {
Navigator,
StyleSheet,
} from 'react-native'
import { StyleSheet } from 'react-native'
import CustomComponents from 'react-native-deprecated-custom-components'

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

render () {
return (
<Navigator.NavigationBar
<CustomComponents.Navigator.NavigationBar
style={[stylesAndroid.navBar, this.props.style]}
routeMapper={this.props.routeMapper}
navState={this.props.navState}
Expand All @@ -34,7 +32,7 @@ class NavBar extends React.Component {
}

NavBar.propTypes = {
...Navigator.NavigationBar.propTypes,
...CustomComponents.Navigator.NavigationBar.propTypes,
}

export default NavBar
7 changes: 4 additions & 3 deletions lib/NavBar.ios.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* @flow */

import React from 'react'
import { Navigator, StyleSheet, PixelRatio } from 'react-native'
import { StyleSheet, PixelRatio } from 'react-native'
import CustomComponents from 'react-native-deprecated-custom-components'

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

render () {
return (
<Navigator.NavigationBar
<CustomComponents.Navigator.NavigationBar
style={[styles.navBar, this.props.style]}
routeMapper={this.props.routeMapper}
navState={this.props.navState}
Expand All @@ -22,7 +23,7 @@ class NavBar extends React.Component {
}

NavBar.propTypes = {
...Navigator.NavigationBar.propTypes,
...CustomComponents.Navigator.NavigationBar.propTypes,
}

const styles = StyleSheet.create({
Expand Down
6 changes: 3 additions & 3 deletions lib/NavigatorWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import React, { PropTypes } from 'react'
import {
View,
Navigator,
BackAndroid,
Platform,
} from 'react-native'
import { defaultRouteMapper } from './RouteMapper'
import NavBar from './NavBar'
import CustomComponents from 'react-native-deprecated-custom-components'

class NavigatorWrapper extends React.Component {
static isAndroid = Platform.OS !== 'ios';
Expand Down Expand Up @@ -75,11 +75,11 @@ class NavigatorWrapper extends React.Component {
}

render () {
const navAnimation = (NavigatorWrapper.isAndroid) ? Navigator.SceneConfigs.FadeAndroid : Navigator.SceneConfigs.PushFromRight
const navAnimation = (NavigatorWrapper.isAndroid) ? CustomComponents.Navigator.SceneConfigs.FadeAndroid : CustomComponents.Navigator.SceneConfigs.PushFromRight
const routeMapper = this.props.routeMapper || defaultRouteMapper()
const NavigationBar = (this.props.hideNavBar) ? null : <NavBar routeMapper={routeMapper} style={this.props.navBarStyle} />
return (
<Navigator
<CustomComponents.Navigator
configureScene={(route, routeStack) => this.props.navigationBarAnimation || navAnimation}
initialRoute={this.props.initialRoute}
initialRouteStack={this.props.initialRouteStack}
Expand Down
7 changes: 4 additions & 3 deletions lib/TopNavigatorWrapper.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/* @flow */

import React, { PropTypes } from 'react'
import { View, Navigator, Platform } from 'react-native'
import { View, Platform } from 'react-native'
import NavigatorWrapper from './NavigatorWrapper'
import { defaultRouteMapper } from './RouteMapper'
import CustomComponents from 'react-native-deprecated-custom-components'

class TopNavigatorWrapper extends React.Component {
static isAndroid = Platform.OS !== 'ios';
Expand Down Expand Up @@ -47,9 +48,9 @@ class TopNavigatorWrapper extends React.Component {
}

render () {
const modalAnimation = (TopNavigatorWrapper.isAndroid) ? Navigator.SceneConfigs.FloatFromBottomAndroid : Navigator.SceneConfigs.FloatFromBottom
const modalAnimation = (TopNavigatorWrapper.isAndroid) ? CustomComponents.Navigator.SceneConfigs.FloatFromBottomAndroid : CustomComponents.Navigator.SceneConfigs.FloatFromBottom
return (
<Navigator
<CustomComponents.Navigator
ref='topNavigator'
renderScene={(route, navigator) => (this._renderScene(route, navigator))}
initialRoute={{id: 'mainComponent'}}
Expand Down
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
},
"homepage": "https://github.com/APSL/react-native-navigator-wrapper#readme",
"devDependencies": {
"babel-eslint": "^4.1.4",
"eslint": "^1.8.0",
"eslint-plugin-react": "^3.7.1"
"babel-eslint": "^7.2.3",
"eslint": "^3.19.0",
"eslint-plugin-react": "^6.10.3",
"prettier": "^1.3.0"
},
"dependencies": {
"react-native-vector-icons": "^2.0.0"
"react-native-deprecated-custom-components": "^0.1.0",
"react-native-vector-icons": "^4.0.1"
}
}
}
Loading

0 comments on commit 3d7acb2

Please sign in to comment.