-
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
Standardize Button Usages #2878
Conversation
The approach I went with for now would be to pass in the "button content" as a prop. That would effectively make it so a button's content could be "anything". However, if that's too much flexibility we could embed the icon into a button as an option and then enable it with a boolean prop flag like |
Totally agree with that, all of this sounds good to me. |
}; | ||
|
||
const ButtonWithLoader = props => ( | ||
<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.
I don't seee TouchableOpacity
used anywhere in the new Button.js
component (I could be missing it). Is there a TouchableOpacity.js
file that could be deleted just like this ButtonWithLoader.js
file?
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.
Ah, nope because this component is built into react-native
.
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 a merge conflict cropped up in one of the files. :(
Other than that, it looks good to me.
I'll look into why these tests are failing in a sec. Probably someone added a |
It was me, I added it lol |
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 pretty straight forward to me.
Gonna merge this to prevent conflicts. |
Details
cc @shawnborton This is a refactor of most of our "button" usages so they will use a common
Button
component to replace theButtonWithLoader
that is pretty underutilized and leads to a lot of duplicate JSX and some style inconsistencies e.g. only certain buttons react to hover styles on web.Fixed Issues
Fixes https://github.com/Expensify/Expensify/issues/164118
Tests
QA Steps
Tested On
Screenshots
Including screenshots to verify the button still works, the only change is that buttons will respond to hover on web and very slight change to the animation - since we are no longer using a
TouchableOpacity
for many buttons.Web
Mobile Web
Desktop
iOS
Android