-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[IMPROVEMENT] User Can Copy Link On hold #1684
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
Changes from 3 commits
60fb8c3
eb1a098
8b3d2ee
03e79e0
07a3a90
84913b4
7a8f5ed
44fe2a4
40d3513
4a280f0
80c3b56
76de1fb
0661d33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,17 @@ | ||
| import React from 'react'; | ||
| import { View, Text, StyleSheet } from 'react-native'; | ||
| import { | ||
| View, | ||
| Text, | ||
| StyleSheet, | ||
| Clipboard, | ||
| ToastAndroid, | ||
| Platform, | ||
| Vibration | ||
| } from 'react-native'; | ||
| import PropTypes from 'prop-types'; | ||
| import FastImage from 'react-native-fast-image'; | ||
| import Touchable from 'react-native-platform-touchable'; | ||
| import isEqual from 'lodash/isEqual'; | ||
|
Comment on lines
1
to
8
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please, undo all changes in this file.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, they'll be undone |
||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Undo these changes. |
||
| import openLink from '../../utils/openLink'; | ||
| import sharedStyles from '../../views/Styles'; | ||
| import { themes } from '../../constants/colors'; | ||
|
|
@@ -81,10 +88,19 @@ const Url = React.memo(({ | |
| } | ||
|
|
||
| const onPress = () => openLink(url.url, theme); | ||
|
|
||
|
djorkaeffalexandre marked this conversation as resolved.
|
||
| const onLongPress = () => { | ||
| Clipboard.setString(url.url); | ||
| if (Platform.os === 'ios') { | ||
| Vibration.vibrate(); | ||
| } else { | ||
| Vibration.vibrate(200); | ||
| ToastAndroid.show('Link copied', ToastAndroid.SHORT); | ||
| } | ||
| }; | ||
|
Comment on lines
+91
to
+93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For first, you don't need to use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, Thanks for the guidance. 👍 |
||
| return ( | ||
| <Touchable | ||
| onPress={onPress} | ||
| onLongPress={onLongPress} | ||
| style={[ | ||
| styles.button, | ||
| index > 0 && styles.marginTop, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included Clipboard, Vibrations, Platform modules of react-native which are not required by Url.js as they aren't required there. I included them for fixing the issue but you redirected me to our own Toast.js component, therefore, I removed the modules.
I'll revert them.