Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Add long press support #40

Merged
merged 2 commits into from
Apr 18, 2017
Merged

Add long press support #40

merged 2 commits into from
Apr 18, 2017

Conversation

XadillaX
Copy link
Contributor

Image this situation: someone want to long press the photo to save it.

@XadillaX
Copy link
Contributor Author

Anyone to merge this PR?


// action behaviour must be implemented by the client
// so, call the client method or simply ignore this event
if (undefined !== this.props.onPhotoLongPress) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about defining a default noop onPhotoLongPress prop instead of undefined checking? Like onPhotoLongPress: () => {}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just copied your previous code.

<TouchableWithoutFeedback
onPress={this._toggleControls}
onLongPress={this._onPhotoLongPressed}
delayLongPress={this.props.delayLongPress || 1000}>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another default prop value would be better here.

@halilb
Copy link
Owner

halilb commented Apr 13, 2017

Hey @XadillaX. Thanks for your time!

I pointed two simple matters and the PR seems fine otherwise. I can merge this right away if you can take a look at them.

@XadillaX
Copy link
Contributor Author

XadillaX commented Apr 14, 2017

I've updated the code.

@XadillaX
Copy link
Contributor Author

You can review the new code now.

@halilb halilb merged commit ce4343a into halilb:master Apr 18, 2017
halilb added a commit that referenced this pull request Apr 18, 2017
@halilb
Copy link
Owner

halilb commented Apr 18, 2017

Thanks @XadillaX, it's merged now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants