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

Refactor uses of react-native Text to ExpensifyText #6658

Merged
merged 10 commits into from
Dec 15, 2021

Conversation

puneetlath
Copy link
Contributor

@puneetlath puneetlath commented Dec 9, 2021

Details

We recently updated our custom Text component to be called ExpensifyText to more clearly distinguish it from the react-native component with the same name. We also added a new rule to our ESLint config preventing the import of the default Text component from react-native. This is because we want people to use our custom component instead.

There were a handful of instances of the default react-native component being used in our code-base. This PR updates those to use our custom component instead. The only file that still imports Text from react-native is our ExpensifyText component, which is built on top of the react-native one.

cc @madmax330 since you reviewed the ESLint PR.

Fixed Issues

#6585

Tests

Open the page for each component that was changed and ensured the text looks the same/normal.

QA Steps

Check each component to make sure the text looks normal. Here's how to get to each component.

CurrentWalletBalance and PaymentMethodList:

  1. log into an account that has no payment methods added
  2. tap the profile icon
  3. Tap payments
  4. Make sure the wallet balance (the big $ amount) and the rest of the text on the page look normal

ExpensiPicker:

  1. log into any account
  2. tap the profile icon
  3. tap profile
  4. make sure the text in the "preferred pronounces" dropdown looks normal

InlineCodeBlock and PressableWithSecondaryInteraction:

  1. Send someone a message that includes a url (i.e. www.expensify.com)
  2. Make sure the text looks normal
  3. Make sure you're able to long-press the text and have the "copy link to clipboard" menu show up
  4. Send someone a message that includes a code block by wrapping the text in "`" characters.
  5. Make sure the text looks normal

MarkerBadge:

  1. Navigate to a chat that has more messages in the history than what shows on the screen
  2. Scroll to the top
  3. From another window, send a message from the other account that is in that chat
  4. Notice the "1 new message" indicator now showing in the original account
  5. Make sure the text in that indicator looks normal

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

CurrentWalletBalance and PaymentMethodList:
image

ExpensiPicker:
Screen Shot 2021-12-08 at 6 28 49 PM

InlineCodeBlock and PressableWithSecondaryInteraction:
Screen Shot 2021-12-09 at 12 08 14 PM

MarkerBadge:
Screen Shot 2021-12-09 at 11 59 48 AM

Mobile Web

CurrentWalletBalance and PaymentMethodList:
Screen Shot 2021-12-09 at 12 35 22 PM

ExpensiPicker:
Screen Shot 2021-12-09 at 12 35 34 PM

InlineCodeBlock and PressableWithSecondaryInteraction:
Screen Shot 2021-12-09 at 12 35 46 PM

MarkerBadge:
Screen Shot 2021-12-09 at 12 36 01 PM

Desktop

CurrentWalletBalance and PaymentMethodList:
Screen Shot 2021-12-09 at 2 12 26 PM

ExpensiPicker:
Screen Shot 2021-12-09 at 2 12 38 PM

InlineCodeBlock and PressableWithSecondaryInteraction:
Screen Shot 2021-12-09 at 2 12 47 PM

MarkerBadge:
Screen Shot 2021-12-09 at 2 13 07 PM

iOS

CurrentWalletBalance and PaymentMethodList:
Screen Shot 2021-12-08 at 8 19 13 PM

ExpensiPicker:
Screen Shot 2021-12-08 at 8 19 41 PM

InlineCodeBlock and PressableWithSecondaryInteraction:
Screen Shot 2021-12-08 at 8 21 49 PM

MarkerBadge:
Screen Shot 2021-12-09 at 12 31 49 PM

Android

CurrentWalletBalance and PaymentMethodList:
Screen Shot 2021-12-08 at 7 43 26 PM

ExpensiPicker:
Screen Shot 2021-12-08 at 7 43 53 PM

InlineCodeBlock and PressableWithSecondaryInteraction:
Screen Shot 2021-12-08 at 7 44 45 PM

MarkerBadge:
Screen Shot 2021-12-09 at 12 26 27 PM

@puneetlath puneetlath changed the title Puneet refactor text Refactor uses of react-native Text to ExpensifyText Dec 9, 2021
@puneetlath puneetlath self-assigned this Dec 9, 2021
@puneetlath puneetlath marked this pull request as ready for review December 9, 2021 19:24
@puneetlath puneetlath requested a review from a team as a code owner December 9, 2021 19:24
@MelvinBot MelvinBot requested review from MonilBhavsar and removed request for a team December 9, 2021 19:25
Copy link
Contributor

@MonilBhavsar MonilBhavsar left a comment

Choose a reason for hiding this comment

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

Looks good! Should we update the documentation to make sure we use ExpensifyText in future

@puneetlath
Copy link
Contributor Author

I updated the ESLint config so that it'll throw an error if anyone uses react-native Text. We can definitely update the documentation as well. I don't see any obvious place to do that though. Anywhere in particular you recommend?

@puneetlath
Copy link
Contributor Author

@MonilBhavsar I removed the comment from src/components/ExpensifyText.js. Let me know if you're good with everything else!

@MonilBhavsar
Copy link
Contributor

I updated the ESLint config so that it'll throw an error if anyone uses react-native Text

That's great! Can you please link that PR.

I don't see any obvious place to do that though. Anywhere in particular you recommend?

I don't see anywhere in documentation where we list components we use. So, all good! I was looking if we can update STYLE.MD for any occurrences of Text, But I saw you already updated it here. Thanks! 😄

@puneetlath
Copy link
Contributor Author

Yep, here you go: Expensify/eslint-config-expensify#38

Copy link
Contributor

@MonilBhavsar MonilBhavsar left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good

@MonilBhavsar MonilBhavsar merged commit 8937621 into main Dec 15, 2021
@MonilBhavsar MonilBhavsar deleted the puneet-refactor-text branch December 15, 2021 10:19
@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 by @MonilBhavsar in version: 1.1.20-3 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @Julesssss in version: 1.1.21-1 🚀

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

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.

3 participants