Skip to content

Commit

Permalink
Merge pull request #17087 from esh-g/button-style-dupe-fix
Browse files Browse the repository at this point in the history
Clean-up dupe button styles
  • Loading branch information
mountiny authored Apr 17, 2023
2 parents cbb22d4 + 8743221 commit 3fa0ed7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
5 changes: 2 additions & 3 deletions src/components/Button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,8 @@ class Button extends Component {
this.props.large ? styles.buttonLarge : undefined,
this.props.success ? styles.buttonSuccess : undefined,
this.props.danger ? styles.buttonDanger : undefined,
(this.props.isDisabled && this.props.success) ? styles.buttonSuccessDisabled : undefined,
(this.props.isDisabled && this.props.danger) ? styles.buttonDangerDisabled : undefined,
(this.props.isDisabled && !this.props.danger && !this.props.success) ? styles.buttonDisable : undefined,
(this.props.isDisabled && (this.props.success || this.props.danger)) ? styles.buttonOpacityDisabled : undefined,
(this.props.isDisabled && !this.props.danger && !this.props.success) ? styles.buttonDisabled : undefined,
(this.props.success && activeAndHovered) ? styles.buttonSuccessHovered : undefined,
(this.props.danger && activeAndHovered) ? styles.buttonDangerHovered : undefined,
this.props.shouldRemoveRightBorderRadius ? styles.noRightBorderRadius : undefined,
Expand Down
2 changes: 1 addition & 1 deletion src/components/CalendarPicker/ArrowIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const ArrowIcon = props => (
<View style={[
styles.p1,
StyleUtils.getDirectionStyle(props.direction),
props.disabled ? styles.calendarButtonDisabled : {},
props.disabled ? styles.buttonOpacityDisabled : {},
]}
>
<Icon src={Expensicons.ArrowRight} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/CalendarPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class CalendarPicker extends React.PureComponent {
StyleUtils.getButtonBackgroundColorStyle(getButtonState(hovered, pressed)),
]}
>
<Text style={isDisabled ? styles.calendarButtonDisabled : styles.dayText}>{day}</Text>
<Text style={isDisabled ? styles.buttonOpacityDisabled : styles.dayText}>{day}</Text>
</View>
)}
</Pressable>
Expand Down
12 changes: 2 additions & 10 deletions src/styles/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ const styles = {
borderWidth: 0,
},

buttonSuccessDisabled: {
buttonOpacityDisabled: {
opacity: 0.5,
},

Expand All @@ -492,16 +492,12 @@ const styles = {
borderWidth: 0,
},

buttonDangerDisabled: {
opacity: 0.5,
},

buttonDangerHovered: {
backgroundColor: themeColors.dangerHover,
borderWidth: 0,
},

buttonDisable: {
buttonDisabled: {
backgroundColor: themeColors.buttonDefaultBG,
borderWidth: 0,
},
Expand Down Expand Up @@ -791,10 +787,6 @@ const styles = {
backgroundColor: themeColors.buttonDefaultBG,
},

calendarButtonDisabled: {
opacity: 0.5,
},

textInputContainer: {
flex: 1,
justifyContent: 'center',
Expand Down

0 comments on commit 3fa0ed7

Please sign in to comment.