-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[22658] Highlight specified cancel buttons #23464
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
Changes from 2 commits
4568b94
2104c2e
dce853a
195f453
59ef366
e2e4175
53b2405
3c240a3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
We should change this with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to |
||
|
||
/** Styles for view */ | ||
// eslint-disable-next-line react/forbid-prop-types | ||
contentStyles: PropTypes.arrayOf(PropTypes.object), | ||
|
@@ -51,6 +54,7 @@ const defaultProps = { | |
danger: false, | ||
onCancel: () => {}, | ||
shouldShowCancelButton: true, | ||
cancelWithHoverEffect: false, | ||
contentStyles: [], | ||
}; | ||
|
||
|
@@ -76,6 +80,7 @@ function ConfirmContent(props) { | |
style={[styles.mt3, styles.noSelect]} | ||
onPress={props.onCancel} | ||
text={props.cancelText || props.translate('common.no')} | ||
default={props.cancelWithHoverEffect} | ||
/> | ||
)} | ||
</View> | ||
|
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 withshouldShowDefaultHoverEffect
.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