fix send button z-index (#16024)

* fix: send button z-index
This commit is contained in:
Omar Basem 2023-05-30 16:46:22 +04:00 committed by GitHub
parent d395ca6cc6
commit 9a4f8f97b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -58,9 +58,9 @@
:i/arrow-up]])
(defn send-button
[{:keys [text-value] :as state} animations window-height images?]
[state animations window-height images?]
(let [btn-opacity (reanimated/use-shared-value 0)
z-index (reagent/atom (if (and (empty? @text-value) (not images?)) 0 1))]
z-index (reagent/atom 0)]
[:f> f-send-button state animations window-height images? btn-opacity z-index]))
(defn audio-button

View File

@ -83,9 +83,10 @@
(reanimated/animate container-opacity 1)))
(defn empty-effect
[{:keys [container-opacity]}
[{:keys [focused?]}
{:keys [container-opacity]}
{:keys [input-text images link-previews? reply audio]}]
(when (utils/empty-input? input-text images link-previews? reply audio)
(when (and (not @focused?) (utils/empty-input? input-text images link-previews? reply audio))
(reanimated/animate-delay container-opacity constants/empty-opacity 200)))
(defn component-will-unmount
@ -102,7 +103,7 @@
(fn []
;; Some subscriptions can arrive after the composer if focused (esp. link
;; previews), so we need to react to changes in `max-height` outside of the
;; `on-focus` handler
;; `on-focus` handler.
(when @focused?
(let [new-height (min max-height (reanimated/get-shared-value last-height))]
(reanimated/set-shared-value last-height new-height)
@ -124,7 +125,7 @@
(images-effect props animations images)
(link-preview-effect state)
(audio-effect state animations audio)
(empty-effect animations subs)
(empty-effect state animations subs)
(kb/add-kb-listeners props state animations dimensions)
#(component-will-unmount props))
[max-height]))