hide command button if there are no commands
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
26b0224236
commit
71ed35b480
|
@ -151,14 +151,16 @@
|
||||||
[seq-input {:command-width width
|
[seq-input {:command-width width
|
||||||
:container-width container-width}]]])))
|
:container-width container-width}]]])))
|
||||||
|
|
||||||
(defn commands-button []
|
(defview commands-button []
|
||||||
[react/touchable-highlight
|
(letsubs [commands-responses [:get-available-commands-responses]]
|
||||||
{:on-press #(do (re-frame/dispatch [:set-chat-input-text constants/command-char])
|
(when (seq commands-responses)
|
||||||
(re-frame/dispatch [:chat-input-focus :input-ref]))
|
[react/touchable-highlight
|
||||||
:accessibility-label :chat-commands-button}
|
{:on-press #(do (re-frame/dispatch [:set-chat-input-text constants/command-char])
|
||||||
[react/view
|
(re-frame/dispatch [:chat-input-focus :input-ref]))
|
||||||
[vi/icon :icons/input-commands {:container-style style/input-commands-icon
|
:accessibility-label :chat-commands-button}
|
||||||
:color :dark}]]])
|
[react/view
|
||||||
|
[vi/icon :icons/input-commands {:container-style style/input-commands-icon
|
||||||
|
:color :dark}]]])))
|
||||||
|
|
||||||
(defview input-container []
|
(defview input-container []
|
||||||
(letsubs [margin [:chat-input-margin]
|
(letsubs [margin [:chat-input-margin]
|
||||||
|
|
Loading…
Reference in New Issue