-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[22658] Highlight specified cancel buttons #23464
[22658] Highlight specified cancel buttons #23464
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.
@DanutGavrus Why do we need to define the props in the page? Is there a different between the cancel button for confirm modal in workspace initial page and the confirm modal in delete message?
Nvm, let's follow the expected result here #22658 (comment).
src/components/Button/index.js
Outdated
@@ -142,6 +145,7 @@ const defaultProps = { | |||
style: [], | |||
innerStyles: [], | |||
textStyles: [], | |||
default: 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 don't think we need to specify props for the default
style if it's only affecting the hover style. We can replace this with shouldShowDefaultHoverEffect
.
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.
Tried to keep it consistent with success and danger styles. Each button may be only 1 of success, danger, default. Would you say shouldShowDefaultHoverEffect
is better?
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.
The button has a default style applied, so adding new props default
just for the hovered seems confusing.
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.
Updated it to shouldHaveHoverEffect
src/components/ConfirmContent.js
Outdated
@@ -36,6 +36,9 @@ const propTypes = { | |||
/** Whether we should show the cancel button */ | |||
shouldShowCancelButton: PropTypes.bool, | |||
|
|||
/** Whether the cancel button has hover effect */ | |||
cancelWithHoverEffect: 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.
Boolean props or variables must be prefixed with should or is to make it clear that they are Boolean. Use should when we are enabling or disabling some features and is in most other cases.
We should change this with the should
prefix.
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.
Updated to shouldCancelBtnHaveHoverEffect
I'm asking for clarification in the Slack channel, and my expectation was this would be applied to all the cancel buttons in the confirm component. Because if we do not do that, similar issues will arise (for example for the delete message confirm modal) and it will cost us more. |
@DanutGavrus If we change all the cancel buttons, we only need to pass the props from |
If we want to highlight only Went ahead and updated with a commit, I will revert if needed. |
I guess the cancel button with decline text still counts as a cancel button, and there are no style differences between those. |
Agree! |
@DanutGavrus Let's add the prop here too for #23196 the fix. App/src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js Lines 453 to 459 in 0fec944
|
Reviewer Checklist
Screenshots/VideosWeb23464.Web.mp4Mobile Web - Chrome23464.mWeb-Chrome.mp4Mobile Web - Safari23464.mWeb-Safari.mp4Desktop23464.Desktop.mp4iOS23464.iOS.mp4Android23464.Android.mp4 |
Done! |
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 and tests well 👍
@DanutGavrus Let's add the test step for edit button on payment page.
@mollfpr Done! |
Congrats, that’s your 5th PR merged! 🎉 Do you know about the ContributorPlus role? It’s an opportunity to earn more in the Expensify Open Source community. Keep up the great work - thanks! |
✋ 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 staging by https://github.com/Gonals in version: 1.3.46-0 🚀
|
🚀 Deployed to staging by https://github.com/Gonals in version: 1.3.47-0 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.3.46-2 🚀
|
🚀 Deployed to production by https://github.com/Beamanator in version: 1.3.47-6 🚀
|
Details
Cancel buttons are not highlighted when the cursor is brought near to them. Added a default style for Buttons & a prop to pass when needed.
Edit button is not highlighted when editing a payment method, passed the previously mentioned prop to this button too.
Fixed Issues
$ #22658
$ #23196
PROPOSAL: #22658 (comment)
Tests
Same as QA Steps.
Offline tests
Same as QA Steps.
QA Steps
I.
II.
III.
IV.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
hover_web.mp4
Mobile Web - Chrome
There is no hover effect on Mobile Web - Chrome.Mobile Web - Safari
There is no hover effect on Mobile Web - Safari.Desktop
iOS
There is no hover effect on iOS.Android
There is no hover effect on Android.