Skip to content

Commit

Permalink
Change active buttons behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Gilles committed Oct 27, 2023
1 parent a2de7bc commit ef36592
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions front/src/components/boxs/alarm/Alarm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class AlarmComponent extends Component {
onClick={this.arm}
disabled={armingDisabled}
class={cx('btn btn-block', style.alarmActionButton, {
'btn-outline-primary': armingDisabled,
'btn-primary': !armingDisabled
'btn-outline-primary': house.alarm_mode !== ALARM_MODES.ARMED,
'btn-primary': house.alarm_mode === ALARM_MODES.ARMED
})}
>
<div class="pb-2">
Expand All @@ -134,8 +134,8 @@ class AlarmComponent extends Component {
onClick={this.disarm}
disabled={house.alarm_mode === ALARM_MODES.DISARMED}
class={cx('btn btn-block', style.alarmActionButton, {
'btn-outline-success': house.alarm_mode === ALARM_MODES.DISARMED,
'btn-success': house.alarm_mode !== ALARM_MODES.DISARMED
'btn-outline-success': house.alarm_mode !== ALARM_MODES.DISARMED,
'btn-success': house.alarm_mode === ALARM_MODES.DISARMED
})}
>
<div class="pb-2">
Expand All @@ -152,7 +152,10 @@ class AlarmComponent extends Component {
<button
onClick={this.partialArm}
disabled={partialArmDisabled}
class={cx('btn btn-secondary btn-block', style.alarmActionButton, {})}
class={cx('btn btn-block', style.alarmActionButton, {
'btn-outline-dark': house.alarm_mode !== ALARM_MODES.PARTIALLY_ARMED,
'btn-dark': house.alarm_mode === ALARM_MODES.PARTIALLY_ARMED
})}
>
<div class="pb-2">
<i class={cx('fe fe-shield', style.alarmActionIcon)} />
Expand All @@ -168,7 +171,10 @@ class AlarmComponent extends Component {
<button
onClick={this.panic}
disabled={house.alarm_mode === ALARM_MODES.PANIC}
class={cx('btn btn-outline-danger btn-block', style.alarmActionButton)}
class={cx('btn btn-block', style.alarmActionButton, {
'btn-outline-danger': house.alarm_mode !== ALARM_MODES.PANIC,
'btn-danger': house.alarm_mode === ALARM_MODES.PANIC
})}
>
<div class="pb-2">
<i class={cx('fe fe-alert-circle', style.alarmActionIcon)} />
Expand Down

0 comments on commit ef36592

Please sign in to comment.