Skip to content

Commit

Permalink
Revert "change DefaultRenderer to correspond new API"
Browse files Browse the repository at this point in the history
  • Loading branch information
aksonov committed Mar 29, 2016
1 parent ce75898 commit 5dcd269
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-router-flux",
"version": "3.3.0-rc",
"version": "3.2.3",
"description": "React Native Router using Flux architecture",
"repository": {
"type": "git",
Expand Down Expand Up @@ -39,7 +39,7 @@
"react-native-tabs": "^1.0.2"
},
"peerDependencies": {
"react-native": "^0.23.0-rc1",
"react-native": "^0.22.0-rc",
"react": "^0.14.7"
},
"devDependencies": {
Expand All @@ -56,7 +56,7 @@
"react": "^0.14.7",
"react-addons-test-utils": "^0.14.7",
"react-dom": "^0.14.7",
"react-native": "^0.23.0-rc1",
"react-native": "^0.22.0",
"react-native-mock": "0.0.6",
"sinon": "^1.17.3"
}
Expand Down
15 changes: 4 additions & 11 deletions src/DefaultRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const {
Card: NavigationCard,
RootContainer: NavigationRootContainer,
Header: NavigationHeader,
CardStackStyleInterpolator: CardStackStyleInterpolator,
LinearPanResponder: LinearPanResponder
} = NavigationExperimental;
import Actions from './Actions';
import getInitialState from './State';
Expand Down Expand Up @@ -55,7 +53,7 @@ export default class DefaultRenderer extends Component {
style={[styles.animatedView, navigationState.style]}
renderOverlay={this._renderHeader}
direction={navigationState.direction || 'horizontal'}
applyAnimation={(pos, navState) =>
setTiming={(pos, navState) =>
Animated.timing(pos, {toValue: navState.index, duration}).start()
}
renderScene={this._renderCard}
Expand All @@ -71,19 +69,14 @@ export default class DefaultRenderer extends Component {
}

_renderCard(/*NavigationSceneRendererProps*/ props) {
const isVertical = props.scene.navigationState.direction === 'vertical';

const style = isVertical ? CardStackStyleInterpolator.forVertical(props) : CardStackStyleInterpolator.forHorizontal(props);
const defaultPanHandlers = isVertical ? LinearPanResponder.forVertical(props) : LinearPanResponder.forHorizontal(props);
const panHandlers = props.scene.navigationState.panHandlers || defaultPanHandlers;

return (
<NavigationCard
{...props}
key={'card_' + props.scene.navigationState.key}
panHandlers={panHandlers}
style = {style}
direction={props.scene.navigationState.direction || 'horizontal'}
panHandlers={props.scene.navigationState.panHandlers }
renderScene={this._renderScene}
style={{backgroundColor:'transparent'}}
/>
);
}
Expand Down

0 comments on commit 5dcd269

Please sign in to comment.