Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/props fixes #143

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ const styles = StyleSheet.create({
| maybeTextStyle | style | Override default style | |
| yupView | element | React component to render on a Yes vote | |
| yupText | string | Text to render on Yes vote | `Yep` |
| noView | element | React component to render on a No vote | |
| noText | string | Text to render on No vote | `Nope` |
| nopeView | element | React component to render on a No vote | |
| nopeText | string | Text to render on No vote | `Nope` |
| maybeView | element | React component to render on a Maybe vote | |
| maybeText | string | Text to render on Maybe vote | `Maybe` |
| smoothTransition | Boolean | Disables a slow transition fading the current card out | `false` |
Expand Down
21 changes: 15 additions & 6 deletions SwipeCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
Animated,
PanResponder,
Dimensions,
Image
ViewPropTypes,
} from 'react-native';

import clamp from 'clamp';
Expand Down Expand Up @@ -96,13 +96,22 @@ export default class SwipeCards extends Component {
handleNope: PropTypes.func,
yupText: PropTypes.string,
yupView: PropTypes.element,
yupStyle: ViewPropTypes.style,
renderYup: PropTypes.func,
maybeText: PropTypes.string,
maybeView: PropTypes.element,
maybeStyle: ViewPropTypes.style,
renderMaybe: PropTypes.func,
nopeText: PropTypes.string,
noView: PropTypes.element,
nopeView: PropTypes.element,
nopeStyle: ViewPropTypes.style,
renderNope: PropTypes.func,
onClickHandler: PropTypes.func,
renderCard: PropTypes.func,
onDragStart: PropTypes.func,
onDragRelease: PropTypes.func,
cardRemoved: PropTypes.func,
renderCard: PropTypes.func,
style: ViewPropTypes.style,
dragY: PropTypes.bool,
smoothTransition: PropTypes.bool
};
Expand All @@ -127,7 +136,7 @@ export default class SwipeCards extends Component {
nopeText: "Nope!",
maybeText: "Maybe!",
yupText: "Yup!",
onClickHandler: () => { alert('tap') },
onClickHandler: () => { },
onDragStart: () => {},
onDragRelease: () => {},
cardRemoved: (ix) => null,
Expand Down Expand Up @@ -470,8 +479,8 @@ export default class SwipeCards extends Component {

if (this.props.showNope) {

const inner = this.props.noView
? this.props.noView
const inner = this.props.nopeView
? this.props.nopeView
: <Text style={[styles.nopeText, this.props.nopeTextStyle]}>{this.props.nopeText}</Text>

return <Animated.View style={[styles.nope, this.props.nopeStyle, animatedNopeStyles]}>
Expand Down