parent
9e72e52737
commit
23b90af064
|
@ -34,25 +34,28 @@
|
||||||
(defn message-input-container [input]
|
(defn message-input-container [input]
|
||||||
[view st/message-input-container input])
|
[view st/message-input-container input])
|
||||||
|
|
||||||
|
(def plain-input-options
|
||||||
|
{:style st-message/message-input
|
||||||
|
:onChangeText plain-message/set-input-message
|
||||||
|
:onSubmitEditing plain-message/send})
|
||||||
|
|
||||||
|
(def command-input-options
|
||||||
|
{:style st-response/command-input
|
||||||
|
:onChangeText command/set-input-message
|
||||||
|
:onSubmitEditing command/send-command})
|
||||||
|
|
||||||
(defview message-input [input-options]
|
(defview message-input [input-options]
|
||||||
[command? [:animations :command?]
|
[command? [:animations :command?]
|
||||||
input-message [:get-chat-input-text]
|
input-message [:get-chat-input-text]
|
||||||
input-command [:get-chat-command-content]]
|
input-command [:get-chat-command-content]]
|
||||||
[text-input (merge {:style (if command?
|
[text-input (merge
|
||||||
st-response/command-input
|
(if command?
|
||||||
st-message/message-input)
|
command-input-options
|
||||||
:ref #(dispatch [:set-message-input %])
|
plain-input-options)
|
||||||
:autoFocus false
|
{:autoFocus false
|
||||||
:blurOnSubmit false
|
:blurOnSubmit false
|
||||||
:onChangeText (if command?
|
:accessibility-label :input}
|
||||||
command/set-input-message
|
input-options)
|
||||||
plain-message/set-input-message)
|
|
||||||
:onSubmitEditing (if command?
|
|
||||||
command/send-command
|
|
||||||
plain-message/send)}
|
|
||||||
(when command?
|
|
||||||
{:accessibility-label :command-input})
|
|
||||||
input-options)
|
|
||||||
(if command? input-command input-message)])
|
(if command? input-command input-message)])
|
||||||
|
|
||||||
(defview plain-message-input-view [{:keys [input-options validator]}]
|
(defview plain-message-input-view [{:keys [input-options validator]}]
|
||||||
|
|
Loading…
Reference in New Issue