DEV: regroups composer button code (#21690)

This commit makes it easier to ensure each button have a similar behavior: hover, disabled, focus...

It also removes some dead code (__inline-button) and fixes a bug where the emoji button didnt have the right un-focused color (it was more visible than it should.
This commit is contained in:
Joffrey JAFFEUX
2023-05-23 10:12:03 +02:00
committed by GitHub
parent d1334a7aaf
commit b8bd3b07ef
3 changed files with 47 additions and 70 deletions

View File

@ -21,7 +21,7 @@
(if this.isFocused "is-focused")
(if this.pane.sending "is-sending")
(if this.sendEnabled "is-send-enabled" "is-send-disabled")
(if this.disabled "is-disabled")
(if this.disabled "is-disabled" "is-enabled")
}}
{{did-update this.didUpdateMessage this.currentMessage}}
{{did-update this.didUpdateInReplyTo this.currentMessage.inReplyTo}}
@ -73,7 +73,7 @@
<Chat::Composer::Button
@icon={{button.icon}}
class={{button.id}}
disabled={{button.disabled}}
disabled={{or this.disabled button.disabled}}
tabindex={{if button.disabled -1 0}}
{{on
"click"
@ -90,7 +90,7 @@
<Chat::Composer::Button
@icon="paper-plane"
class="chat-composer__send-btn"
class="chat-composer__send-btn primary"
title={{i18n "chat.composer.send"}}
disabled={{or this.disabled (not this.sendEnabled)}}
tabindex={{if this.sendEnabled 0 -1}}