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

Added tapable links to user's login information on DetailsPage #3870

Merged
merged 11 commits into from
Jul 12, 2021

Conversation

parasharrajat
Copy link
Member

@parasharrajat parasharrajat commented Jul 2, 2021

Details

Fixed Issues

$ Fixes #3476

Tests | QA Steps

  1. Open Any conversation on E.cash.
  2. Click on the other user's name on the Chat Title.
  3. Details page should open.
  4. Now Click on Either the mobile number of the user or its email.
  5. Clicking on the mobile Number should open the Dialer.
  6. Clicking on Email should prompt for mailing.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web | Desktop

tap-w.mp4

Mobile Web

tap-m.mp4

iOS

Android

tap-a.mp4

@parasharrajat parasharrajat marked this pull request as ready for review July 7, 2021 10:08
@parasharrajat parasharrajat requested a review from a team as a code owner July 7, 2021 10:08
@MelvinBot MelvinBot requested review from chiragsalian and removed request for a team July 7, 2021 10:08
src/pages/DetailsPage.js Outdated Show resolved Hide resolved
src/pages/DetailsPage.js Outdated Show resolved Hide resolved
src/components/TappableCopy.js Outdated Show resolved Hide resolved
src/components/TappableCopy.js Outdated Show resolved Hide resolved
src/components/TappableCopy.js Outdated Show resolved Hide resolved
src/components/TappableCopy.js Outdated Show resolved Hide resolved
styles.justifyContentCenter,
{right: -36, top: 0, bottom: 0}]}
>
<ReportActionContextMenuItem
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems incorrect to re-use a ReportActionContextMenuItem here, no?

This is not inside the ReportActionContextMenu 🤔

Copy link
Member Author

@parasharrajat parasharrajat Jul 7, 2021

Choose a reason for hiding this comment

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

Yeah. I think we should rename it as we need exactly the same behaviour. Any name suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

i would vote to rename it to ContextMenuItem

@parasharrajat
Copy link
Member Author

@chiragsalian Updated. Thanks.

Copy link
Contributor

@chiragsalian chiragsalian left a comment

Choose a reason for hiding this comment

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

@parasharrajat
Copy link
Member Author

@chiragsalian All set. Updated.

chiragsalian
chiragsalian previously approved these changes Jul 9, 2021
Copy link
Contributor

@chiragsalian chiragsalian left a comment

Choose a reason for hiding this comment

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

LGTM, leaving final review/merge to you @marcaaron since you did leave a comment.

src/components/TappableCopy.js Outdated Show resolved Hide resolved
src/components/TappableCopy.js Outdated Show resolved Hide resolved

const defaultProps = {
style: [],
type: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite understand this. When are we using this component and why would it not have a type? It looks like if there's no type we just return an empty View. 🤔

Can we maybe give this a better name than TappableCopy? It looks like it has a pretty specific purpose i.e. wrap anything (I don't see anything that limits this to "copy") in a Pressable and then do an email or phone link or generically copy the text to clipboard.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something like CommunicationsLink

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

There were two points to address so I'm reopening. Please allow reviewers to resolve comments.

src/components/TappableCopy.js Outdated Show resolved Hide resolved
@parasharrajat
Copy link
Member Author

@marcaaron Updated. thanks

@parasharrajat
Copy link
Member Author

Updated

@parasharrajat
Copy link
Member Author

Conflict resolved. Updated.

onPress={() => Clipboard.setString(props.value)}
/>
</View>
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Still don't get the checks for props.type. What is using this without a type? If there's no type we show props.children? We should not use it at all in that case.

Copy link
Member Author

Choose a reason for hiding this comment

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

To make CommunicationLink uses cleaner I did this. Otherwise, we have to conditionally show the content wrapped in CommunicationLink which will duplicate a few lines on the main Component and This approach gives it a cleaner usage. https://github.com/parasharrajat/Expensify.cash/blob/a6814422a60fbba13d04e19f2807190a82450c2f/src/pages/DetailsPage.js#L95.

I will welcome suggestions to improve it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I am removing the confusing uses of Type. Instead, just use the conditional block here https://github.com/parasharrajat/Expensify.cash/blob/a6814422a60fbba13d04e19f2807190a82450c2f/src/pages/DetailsPage.js#L95

Copy link
Contributor

@marcaaron marcaaron Jul 12, 2021

Choose a reason for hiding this comment

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

Perfect thanks!

Otherwise, we have to conditionally show the content wrapped in CommunicationLink which will duplicate a few lines on the main Component and This approach gives it a cleaner usage.

I have a different opinion. To me it's not clear why we should use a component that might do nothing at all. It's as if we are calling a function with an optional argument that specifies whether we should call the function or not. In this case, it's clearer to just not call the function in the first place.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for clarifying.

@parasharrajat
Copy link
Member Author

Updated.

@marcaaron marcaaron merged commit c6fa493 into Expensify:main Jul 12, 2021
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

🚀 Deployed to staging in version: 1.0.77-6🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

🚀 Deployed to production in version: 1.0.79-4🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@parasharrajat parasharrajat deleted the tap-details branch November 20, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Phone number accounts - Phone numbers should be tappable
4 participants