Magic suggestions area (#772)
This commit is contained in:
parent
ace355515a
commit
27ddb24f7b
|
@ -239,14 +239,11 @@
|
||||||
(register-sub :input-margin
|
(register-sub :input-margin
|
||||||
(fn []
|
(fn []
|
||||||
(let [kb-height (subscribe [:get :keyboard-height])
|
(let [kb-height (subscribe [:get :keyboard-height])
|
||||||
focused (subscribe [:get :focused])
|
|
||||||
mode (subscribe [:kb-mode])
|
|
||||||
kb-max (subscribe [:get :keyboard-max-height])
|
kb-max (subscribe [:get :keyboard-max-height])
|
||||||
show-emoji? (subscribe [:chat-ui-props :show-emoji?])]
|
show-emoji? (subscribe [:chat-ui-props :show-emoji?])]
|
||||||
(reaction
|
(reaction
|
||||||
(cond @show-emoji? (or @kb-max c/emoji-container-height)
|
(cond @show-emoji? (or @kb-max c/emoji-container-height)
|
||||||
ios? @kb-height
|
ios? @kb-height
|
||||||
(and @focused (= :pan @mode) (pos? @kb-height)) 20
|
|
||||||
:else 0)))))
|
:else 0)))))
|
||||||
|
|
||||||
(register-sub :max-layout-height
|
(register-sub :max-layout-height
|
||||||
|
|
|
@ -151,10 +151,20 @@
|
||||||
(when (seq suggestions) suggestions))
|
(when (seq suggestions) suggestions))
|
||||||
|
|
||||||
(defn response-view []
|
(defn response-view []
|
||||||
(let [response-height (anim/create-value c/input-height)]
|
(let [response-height (anim/create-value c/input-height)
|
||||||
|
command (subscribe [:get-chat-command])
|
||||||
|
suggestions (subscribe [:get-content-suggestions])
|
||||||
|
errors (subscribe [:validation-errors])
|
||||||
|
custom-errors (subscribe [:custom-validation-errors])]
|
||||||
|
(fn []
|
||||||
|
(when (or (:fullscreen @command)
|
||||||
|
(= :response (:type @command))
|
||||||
|
(seq @suggestions)
|
||||||
|
(seq @errors)
|
||||||
|
(seq @custom-errors))
|
||||||
[container response-height
|
[container response-height
|
||||||
[request-info response-height]
|
[request-info response-height]
|
||||||
[suggestions-web-view]
|
[suggestions-web-view]
|
||||||
[response-suggestions-view]
|
[response-suggestions-view]
|
||||||
[cv/validation-messages]
|
[cv/validation-messages]
|
||||||
[placeholder]]))
|
[placeholder]]))))
|
||||||
|
|
Loading…
Reference in New Issue