Skip to content

Commit d68806f

Browse files
authored
Merge pull request #23464 from DanutGavrus/fix/22658-highlight-cancel-button
[22658] Highlight specified cancel buttons
2 parents 3d22f59 + 3c240a3 commit d68806f

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/components/Button/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ const propTypes = {
8787
// eslint-disable-next-line react/forbid-prop-types
8888
textStyles: PropTypes.arrayOf(PropTypes.object),
8989

90+
/** Whether we should use the default hover style */
91+
shouldUseDefaultHover: PropTypes.bool,
92+
9093
/** Whether we should use the success theme color */
9194
success: PropTypes.bool,
9295

@@ -142,6 +145,7 @@ const defaultProps = {
142145
style: [],
143146
innerStyles: [],
144147
textStyles: [],
148+
shouldUseDefaultHover: false,
145149
success: false,
146150
danger: false,
147151
children: null,
@@ -295,6 +299,7 @@ class Button extends Component {
295299
...this.props.innerStyles,
296300
]}
297301
hoverStyle={[
302+
this.props.shouldUseDefaultHover && !this.props.isDisabled ? styles.buttonDefaultHovered : undefined,
298303
this.props.success && !this.props.isDisabled ? styles.buttonSuccessHovered : undefined,
299304
this.props.danger && !this.props.isDisabled ? styles.buttonDangerHovered : undefined,
300305
]}

src/components/ConfirmContent.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ function ConfirmContent(props) {
7676
style={[styles.mt3, styles.noSelect]}
7777
onPress={props.onCancel}
7878
text={props.cancelText || props.translate('common.no')}
79+
shouldUseDefaultHover
7980
/>
8081
)}
8182
</View>

src/pages/settings/Payments/PaymentsPage/BasePaymentsPage.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ class BasePaymentsPage extends React.Component {
455455
onPress={this.navigateToAddPaypalRoute}
456456
style={[styles.mb4]}
457457
text={this.props.translate('common.edit')}
458+
shouldUseDefaultHover
458459
/>
459460
)}
460461
<Button

src/styles/styles.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,11 @@ const styles = {
525525
textAlign: 'center',
526526
},
527527

528+
buttonDefaultHovered: {
529+
backgroundColor: themeColors.buttonHoveredBG,
530+
borderWidth: 0,
531+
},
532+
528533
buttonSuccess: {
529534
backgroundColor: themeColors.success,
530535
borderWidth: 0,

0 commit comments

Comments
 (0)