diff --git a/CardStack.js b/CardStack.js index bec0f54..06d58d3 100644 --- a/CardStack.js +++ b/CardStack.js @@ -370,6 +370,105 @@ export default class CardStack extends Component { } + renderTop(drag, cardA, cardB, topCard, SC, rotate) { + if(topCard == "cardB"){ + return ( + + {cardB} + + ); + } + else{ + return ( + + {cardA} + + ) + } + } + + renderBottom(drag, cardA, cardB, topCard, SC, rotate) { + if(topCard == "cardA"){ + return ( + + {cardB} + + ); + } + else{ + return ( + + {cardA} + + ) + } + } + + render() { const { secondCardZoom } = this.props; @@ -385,48 +484,10 @@ export default class CardStack extends Component { outputRange: this.props.outputRotationRange, extrapolate: 'clamp', }); - return ( - - {cardB} - - - {cardA} - - + {this.renderBottom(drag, cardA, cardB, topCard, SC, rotate)} + {this.renderTop(drag, cardA, cardB, topCard, SC, rotate)} {this.props.renderNoMoreCards()}