Merge #39 from eraydemirok/master

This commit is contained in:
Ludwig Händel
2018-12-04 22:40:12 +01:00
parent 5ca1e2dd16
commit e8c3281d7b
3 changed files with 21 additions and 8 deletions

View File

@@ -370,6 +370,14 @@ export default class CardStack extends Component {
}
/**
* @description CardBs click feature is trigger the CardA on the card stack. (Solved on Android)
* @see https://facebook.github.io/react-native/docs/view#pointerevents
*/
_setPointerEvents(topCard, topCardName) {
return { pointerEvents: topCard === topCardName ? "auto" : "none" }
}
render() {
const { secondCardZoom } = this.props;
@@ -388,7 +396,12 @@ export default class CardStack extends Component {
return (
<View {...this._panResponder.panHandlers} style={[{position:'relative'},this.props.style]}>
<Animated.View style={{
{this.props.renderNoMoreCards()}
<Animated.View
{...this._setPointerEvents(topCard, 'cardB')}
style={{
position: 'absolute',
zIndex: (topCard === 'cardB') ? 3 : 2,
...Platform.select({
@@ -405,7 +418,9 @@ export default class CardStack extends Component {
}}>
{cardB}
</Animated.View>
<Animated.View style={{
<Animated.View
{...this._setPointerEvents(topCard, 'cardA')}
style={{
position: 'absolute',
zIndex: (topCard === 'cardA') ? 3 : 2,
...Platform.select({
@@ -423,8 +438,6 @@ export default class CardStack extends Component {
{cardA}
</Animated.View>
{this.props.renderNoMoreCards()}
</View>
);
}
@@ -490,5 +503,5 @@ CardStack.defaultProps = {
outputRotationRange: ['-15deg','0deg','15deg'],
duration: 200
}
}

View File

@@ -8,7 +8,7 @@
},
"dependencies": {
"react": "16.0.0",
"react-native": "0.50.4",
"react-native": "^0.57.7",
"react-native-card-stack-swiper": "^1.0.4"
},
"devDependencies": {

View File

@@ -1,6 +1,6 @@
{
"name": "react-native-card-stack-swiper",
"version": "1.0.6",
"version": "1.1.0",
"description": "Tinder like react-native card stack swiper",
"main": "index.js",
"scripts": {