-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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] Code cleanup / Add story for OptionRow #8016
Conversation
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.
This is all good cleanup, so LGTM 👍 . Whether or not you want to take the time to address the other comments is up to you.
@@ -33,4 +34,16 @@ export default PropTypes.shape({ | |||
|
|||
// Whether the report corresponds to a chat room | |||
isChatRoom: PropTypes.bool, | |||
|
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 see that OptionRow
's memo
function references option.hasOutstandingIOU
, but that seems missing here. Do we need to add it, or has it been removed at some point?
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.
Looks like we need to add it! On it!
@@ -77,7 +77,7 @@ const defaultProps = { | |||
forceTextUnreadStyle: false, | |||
showTitleTooltip: false, | |||
mode: 'default', | |||
onSelectRow: null, | |||
onSelectRow: () => {}, | |||
isDisabled: false, |
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've looked into it, and it seems like the isDisabled
prop of this component is never used. Furthermore, it's pretty similar to disableRowInteractivity
– looks like isDisabled
only affects the cursor style on hover, while disableRowInteractivity
actually disables pressing on the row.
In my opinion, it would be good cleanup to rename disableRowInteractivity
to isDisabled
, and then make the single isDisabled
prop both change the cursor style on hover and disable the TouchableOpacity
.
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.
Nice. I think that makes sense to me. disableRowInteractivity
doesn't really fit our other naming conventions and isDisabled
is a much better name.
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.
lgtm, verified the OptionRow
appears and no JS errors in the console as well
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to production by @chiragsalian in version: 1.1.42-6 🚀
|
Details
OptionRow
is a fairly commonly used component, but for some reason was in/sidebar/
directory instead ofcomponents
/components
./components
and created a story for theOptionRow
so it is easier to see when to use it vs. something likeMenuItem
Fixed Issues
No issue in particular just adding a story for OptionRow / cleaning stuff up
Tests
npm run storybook
and verify theOptionRow
appearsQA Steps
❌
Screenshots