Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ludwig Händel committed Nov 21, 2017
1 parent 8ea951d commit fa6864d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CardStack.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export default class CardStack extends Component {
this._nextCard('top', 0, -height, duration);
}

swipedBottom(){
swipeBottom(){
this._nextCard('bottom', 0, height, duration);
}

Expand Down
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import CardStack, { Card } from 'react-native-card-stack-swiper';
```

```javascript
<CardStack style={styles.content} >
<CardStack style={styles.content} ref={swiper => { this.swiper = swiper }}>
<Card style={[styles.card, styles.card1]}><Text style={styles.label}>A</Text></Card>
<Card style={[styles.card, styles.card2]}><Text style={styles.label}>B</Text></Card>
<Card style={[styles.card, styles.card1]}><Text style={styles.label}>C</Text></Card>
Expand Down Expand Up @@ -49,6 +49,30 @@ import CardStack, { Card } from 'react-native-card-stack-swiper';
| onSwipedBottom | func | function to be called when a card is swiped bottom. it receives the swiped card index |


## CardStack actions
| Props | type |
| ----------------- | ------------- |
| swipeLeft | func |
| swipeRight | func |
| swipeBottom | func |
| swipeTop | func |
| goBackFromLeft | func |
| goBackFromRight | func |
| goBackFromBottom | func |
| goBackFromTop | func |

```javascript
<CardStack style={styles.content} ref={swiper => { this.swiper = swiper }}>
<Card style={[styles.card, styles.card1]}><Text style={styles.label}>A</Text></Card>
<Card style={[styles.card, styles.card2]}><Text style={styles.label}>B</Text></Card>
</CardStack>

<TouchableOpacity onPress={ () => { this.swiper.swipeLeft() }}>
<Text>Left</Text>
</TouchableOpacity>
```


# Card

## Card props
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-card-stack-swiper",
"version": "1.0.1",
"version": "1.0.2",
"description": "Tinder like react-native card stack swiper",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit fa6864d

Please sign in to comment.