mirror of
https://github.com/zhigang1992/react-native-card-stack-swiper.git
synced 2026-05-30 17:43:02 +08:00
Merge #39 from eraydemirok/master
This commit is contained in:
25
CardStack.js
25
CardStack.js
@@ -370,6 +370,14 @@ export default class CardStack extends Component {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description CardB’s 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
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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": {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
Reference in New Issue
Block a user