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

[No QA] Rename and cleanup OptionRowTitle #2215

Merged
merged 12 commits into from
Apr 10, 2021
Merged

Conversation

roryabraham
Copy link
Contributor

@roryabraham roryabraham commented Apr 2, 2021

Details

  • Renames OptionRowTitle to a more generic DisplayNames component
  • Decouples the component from any 'option' app logic (i.e: it just takes in an array of objects that look like:
{displayName: 'Rory Abraham', tooltip: '[email protected]'}
  • Generalizes a style used by the component into a utility.
  • I also snuck in one fix to a propTypes warning present on master.

Fixed Issues

No issue, coming from this comment.

Tests (web/desktop)

Run the app, make sure tooltips are working as expeceted on report titles and option rows.

Tests (mWeb/ios/android)

Run the app, make sure there are no regressions.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

image
image
image
image

Desktop

image
image
image
image

@roryabraham roryabraham requested a review from marcaaron April 2, 2021 20:04
@roryabraham roryabraham requested a review from a team as a code owner April 2, 2021 20:04
@roryabraham roryabraham self-assigned this Apr 2, 2021
@MelvinBot MelvinBot requested review from AndrewGable and removed request for a team April 2, 2021 20:05
@parasharrajat
Copy link
Member

Could you please fix the Prop check here as well? undefined to {}
https://github.com/Expensify/Expensify.cash/blob/d3f1d28478357e2a66b155e660def191d6ed79a8/src/pages/home/sidebar/OptionRow.js#L139-L150
I am closing my PR #2212 in favour of this.

@parasharrajat parasharrajat mentioned this pull request Apr 3, 2021
@roryabraham
Copy link
Contributor Author

@parasharrajat I'm not seeing how the secondAvatarStyle is related to this PR

@roryabraham
Copy link
Contributor Author

Also @parasharrajat, it looks like from your other PR we can simplify hasEllipsis to one file, so I'll add that here too. Can you help me come up with a more generic name that describes what this function does? Maybe hasContentWiderThanScrollWidth?

@parasharrajat
Copy link
Member

parasharrajat commented Apr 3, 2021

Name looks promising. 👍

@parasharrajat I'm not seeing how the secondAvatarStyle is related to this PR

There was prop type error and I thought as we are changing OptionRow so this can be fixed as well.

@marcaaron
Copy link
Contributor

Sorry was a little slow to review this and there's a conflict now.

# Conflicts:
#	src/styles/styles.js
@roryabraham
Copy link
Contributor Author

All good, merge conflict resolved

Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

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

Changes look great to me. Just had a few small comments.

src/components/DisplayNames/DisplayNamesPropTypes.js Outdated Show resolved Hide resolved
@@ -0,0 +1,30 @@
import PropTypes from 'prop-types';

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure where to put this, but I think as a convention we should not use pascal case for things that are not namespaces or react components. If you look most other propTypes files are using camelcase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm... confused by this comment because a case-insensitive global search of import prop in Expensify.cash shows that almost all usages use PascalCase:

image

The exceptions are when we have a propTypes file, we export {propTypes, defaultProps} using camelCase. Were you referring to the file name? I think that's what you meant, so I changed the filename to use camelCase. It looks like we have been pretty inconsistent about this so far, so happy to standardize.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry @roryabraham I was referring to the file name.

src/components/DisplayNames/index.js Outdated Show resolved Hide resolved
src/components/DisplayNames/DisplayNamesPropTypes.js Outdated Show resolved Hide resolved
@marcaaron marcaaron merged commit ce6ed3f into master Apr 10, 2021
@marcaaron marcaaron deleted the Rory-RenameOptionRowTitle branch April 10, 2021 00:35
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