Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: upgrade our master to newest version of v3 branch upstream #10

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b00e0f1
use version of react-native-tabs that support testID
sondremare Sep 28, 2016
8b85679
fix: use version of react native tabs that cleanup keyboard listeners
sondremare Oct 11, 2016
b303f6c
fix: use version of react native tabs that cleanup keyboard listeners
sondremare Oct 11, 2016
495a733
fix: use version of react native tabs that support accessibilityLabels
sondremare Nov 6, 2016
32e5d78
feat(navbar): support accessibilityLabel
sondremare Nov 6, 2016
3d4971b
feat(navbar): add testID and accessibilityLabel to title
sondremare Nov 23, 2016
089a091
feat(animation): use the native driver for animation
denistakeda Mar 28, 2017
bcbd978
Merge pull request #1 from EdtechFoundry/feat-native-animation
denistakeda Mar 28, 2017
ed33019
chore: add CI badge (#2)
kennethlynne Mar 28, 2017
3e95f09
Merge remote-tracking branch 'aksonov/master' (#3)
kennethlynne Mar 29, 2017
97895f5
Merge remote-tracking branch 'aksonov/master'
kennethlynne Mar 29, 2017
66ee094
chore: bump to version 3.38.1
kennethlynne Mar 29, 2017
e99c4dd
fix: remove typings (causing problems)
kennethlynne Mar 29, 2017
506af6e
chore: bump version to 3.38.2
kennethlynne Mar 29, 2017
06b3c79
fix: use react-native 0.42.0
kennethlynne Mar 29, 2017
cca3f30
chore: bump to version 3.38.3
kennethlynne Mar 29, 2017
9104a1a
feat(animation): use the native driver for animation (#4)
denistakeda Mar 29, 2017
14b115f
fix(navbar): fix title not being shown (#5)
sondremare Apr 3, 2017
cb6bbf4
chore: update version to 3.38.6
sondremare Apr 3, 2017
88f5167
feat(back): give the back function access to props (#7)
sondremare Aug 30, 2017
5879800
chore: release version 3.39.0
sondremare Aug 30, 2017
ab8c49e
fix: move react-native to peer dependency to prevent crashes
sondremare Oct 6, 2017
761c8e0
chore: release 3.39.0-0
sondremare Oct 6, 2017
acae094
fix: use BackHandler instead of BackAndroid due to it being deprecated
sondremare Oct 6, 2017
55f294c
chore: release version 3.39.0-1
sondremare Oct 6, 2017
b9b2bf2
fix: upgrade react and fix prop-types (#9)
sondremare Oct 7, 2017
55c6ae0
chore: release 3.39.0-2
sondremare Oct 7, 2017
f4efb79
Merge branch 'v3' of github.com:aksonov/react-native-router-flux into…
sondremare Oct 19, 2017
3063930
use fork of experimental navigation that uses correct proptypes
sondremare Oct 19, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# React Native Router [![Join the chat at https://gitter.im/aksonov/react-native-router-flux](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aksonov/react-native-router-flux?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Codacy Badge](https://api.codacy.com/project/badge/grade/c6d869e2367a4fb491efc9de228c5ac6)](https://www.codacy.com/app/aksonov-github/react-native-router-flux) [![npm version](https://badge.fury.io/js/react-native-router-flux.svg)](http://badge.fury.io/js/react-native-router-flux) [![CircleCI](https://circleci.com/gh/aksonov/react-native-router-flux.svg?style=svg)](https://circleci.com/gh/aksonov/react-native-router-flux)
# React Native Router [![Join the chat at https://gitter.im/aksonov/react-native-router-flux](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/aksonov/react-native-router-flux?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Codacy Badge](https://api.codacy.com/project/badge/grade/c6d869e2367a4fb491efc9de228c5ac6)](https://www.codacy.com/app/aksonov-github/react-native-router-flux) [![npm version](https://badge.fury.io/js/react-native-router-flux.svg)](http://badge.fury.io/js/react-native-router-flux) [![CircleCI](https://circleci.com/gh/EdtechFoundry/react-native-router-flux.svg?style=svg&circle-token=9b5d3dcef6c6e9cca4af163fba0e1fbf3e8620ae)](https://circleci.com/gh/EdtechFoundry/react-native-router-flux)

[![NPM](https://nodei.co/npm/react-native-router-flux.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/react-native-router-flux/)
[![NPM](https://nodei.co/npm/react-native-router-flux.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/react-native-router-flux/)
Router for React Native based on new React Native Navigation API.

Please check latest 4.0.0-beta.* , Example as demo:
Expand Down
2 changes: 1 addition & 1 deletion docs/API_CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
| children | | required (if no scenes property passed)| Scene root element |
| scenes | `object` | optional | scenes for Router created with Actions.create. This will allow to create all actions BEFORE React processing. If you don't need it you may pass Scene root element as children |
| getSceneStyle | `function` | optional | Optionally override the styles for NavigationCard's Animated.View rendering the scene. |
| backAndroidHandler | `function` | optional | Optionally override the handler for `BackAndroid`, return `true` to stay in the app or return `false` to exit the app. Default handler will pop a scene and exit the app at last when the back key is pressed on Android. |
| backAndroidHandler | `function` | optional | Optionally override the handler for `BackHandler`, return `true` to stay in the app or return `false` to exit the app. Default handler will pop a scene and exit the app at last when the back key is pressed on Android. |
| onBackAndroid | `function` | optional | Get called after back key is pressed and a scene is popped, won't affect the default behavior. |
| onExitApp | `function` | optional | Optionally override the default action after back key is pressed on root scene. Return `true` to stay, or return `false` to exit the app. |

Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-router-flux",
"version": "3.41.0",
"version": "3.41.0-0",
"description": "React Native Router using Flux architecture",
"repository": {
"type": "git",
Expand Down Expand Up @@ -37,15 +37,19 @@
],
"dependencies": {
"lodash.isequal": "^4.5.0",
"react-native-experimental-navigation": "^0.28.0",
"react-native-experimental-navigation": "https://github.com/EdtechFoundry/react-native-experimental-navigation.git#0.26.10-1.0.0",
"react-native-tabs": "^1.0.9",
"react-static-container": "^1.0.1"
},
"devDependencies": {
"@edtechfoundry/react-native-mock": "^0.4.4",
"babel-eslint": "^7.2.3",
"babel-jest": "20.0.3",
"babel-jest": "19.0.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-react-native": "2.0.0",
"babel-preset-react-native-stage-0": "^1.0.1",
"babel-preset-stage-0": "^6.22.0",
"chai": "^3.5.0",
"eslint": "^3.1.1",
"eslint-plugin-react": "^7.1.0",
Expand Down
11 changes: 9 additions & 2 deletions src/DefaultRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*/
import React, {
PureComponent,
PropTypes,
} from 'react';
import PropTypes from 'prop-types';
import {
Animated,
View,
Expand Down Expand Up @@ -339,7 +339,14 @@ export default class DefaultRenderer extends PureComponent {
if (duration === 0) {
pos.setValue(navState.index);
} else {
Animated.timing(pos, { toValue: navState.index, duration }).start();
Animated.timing(
pos,
{
toValue: navState.index,
useNativeDriver: true,
duration,
},
).start();
}
};
}
Expand Down
4 changes: 1 addition & 3 deletions src/Modal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import React, {
PropTypes,
} from 'react';
import PropTypes from 'prop-types';
import {
View,
} from 'react-native';
Expand Down
32 changes: 14 additions & 18 deletions src/NavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
import React, {
PropTypes,
} from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import {
Platform,
Animated,
Expand Down Expand Up @@ -182,7 +181,6 @@ const propTypes = {
getTitle: PropTypes.func,
titleWrapperStyle: Text.propTypes.style,
titleStyle: Text.propTypes.style,
titleOpacity: PropTypes.number,
titleProps: PropTypes.any,
position: PropTypes.object,
navigationBarStyle: ViewPropTypes.style,
Expand All @@ -202,7 +200,6 @@ const contextTypes = {
const defaultProps = {
drawerImage: _drawerImage,
backButtonImage: _backButtonImage,
titleOpacity: 1,
};

class NavBar extends React.Component {
Expand Down Expand Up @@ -243,6 +240,7 @@ class NavBar extends React.Component {
return (
<BackButton
testID="backNavButton"
accessibilityLabel="backNavButton"
textButtonStyle={textButtonStyle}
{...childState}
style={style}
Expand All @@ -253,7 +251,7 @@ class NavBar extends React.Component {
state.backButtonImage || this.props.backButtonImage;
let onPress = childState.onBack || childState.component.onBack;
if (onPress) {
onPress = onPress.bind(null, state);
onPress = onPress.bind(null, state, this.props);
} else {
onPress = Actions.pop;
}
Expand All @@ -267,6 +265,7 @@ class NavBar extends React.Component {
return (
<TouchableOpacity
testID="backNavButton"
accessibilityLabel="backNavButton"
style={style}
onPress={onPress}
>
Expand Down Expand Up @@ -315,6 +314,7 @@ class NavBar extends React.Component {
{...state}
key={'rightNavBarBtn'}
testID="rightNavButton"
accessibilityLabel={self.props.rightAccessibilityLabel}
style={style}
textButtonStyle={textStyle}
/>
Expand Down Expand Up @@ -342,6 +342,7 @@ class NavBar extends React.Component {
<TouchableOpacity
key={'rightNavBarBtn'}
testID="rightNavButton"
accessibilityLabel={self.props.rightAccessibilityLabel}
style={style}
onPress={onPress}
>
Expand Down Expand Up @@ -474,6 +475,7 @@ class NavBar extends React.Component {
>
<Animated.Text
lineBreakMode="tail"
accessibilityLabel={'title'}
numberOfLines={1}
{...this.props.titleProps}
style={[
Expand All @@ -482,18 +484,12 @@ class NavBar extends React.Component {
this.props.navigationState.titleStyle,
childState.titleStyle,
{
opacity: this.props.position.interpolate({
inputRange: [index - 1, index, index + 1],
outputRange: [0, this.props.titleOpacity, 0],
}),
left: this.props.position.interpolate({
inputRange: [index - 1, index + 1],
outputRange: [200, -200],
}),
right: this.props.position.interpolate({
inputRange: [index - 1, index + 1],
outputRange: [-200, 200],
}),
transform: [{
translateX: this.props.position.interpolate({
inputRange: [index - 1, index + 1],
outputRange: [300, -300],
}),
}],
},
]}
>
Expand Down
2 changes: 1 addition & 1 deletion src/Router.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
*/
import React, {
Component,
PropTypes,
} from 'react';
import PropTypes from 'prop-types';
import { BackHandler } from 'react-native';
import NavigationExperimental from 'react-native-experimental-navigation';

Expand Down
3 changes: 2 additions & 1 deletion src/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
* LICENSE file in the root directory of this source tree.
*
*/
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import { ViewPropTypes, Text } from 'react-native';

export default class extends React.Component {
Expand Down
3 changes: 2 additions & 1 deletion src/Switch.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { PropTypes } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import TabBar from './TabBar';
import Actions from './Actions';

Expand Down
3 changes: 2 additions & 1 deletion src/TabBar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import {
Image,
View,
Expand Down
3 changes: 2 additions & 1 deletion src/TabbedView.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { Component, PropTypes } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { View, StyleSheet, ViewPropTypes } from 'react-native';
import StaticContainer from 'react-static-container';

Expand Down