fix: use custom color for send button (#17146)

This commit is contained in:
BalogunofAfrica 2023-09-01 10:47:21 +01:00 committed by GitHub
parent 7e9ba0768a
commit d35dbff044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 18 deletions

View File

@ -45,24 +45,27 @@
[props {:keys [text-value] :as state} [props {:keys [text-value] :as state}
animations window-height images? animations window-height images?
btn-opacity z-index edit] btn-opacity z-index edit]
(rn/use-effect (fn [] (let [customization-color (rf/sub [:profile/customization-color])]
(if (or (seq @text-value) images?) (rn/use-effect (fn []
(when (or (not= @z-index 1) (not= (reanimated/get-shared-value btn-opacity) 1)) (if (or (seq @text-value) images?)
(reset! z-index 1) (when (or (not= @z-index 1) (not= (reanimated/get-shared-value btn-opacity) 1))
(js/setTimeout #(reanimated/animate btn-opacity 1) 50)) (reset! z-index 1)
(when (or (not= @z-index 0) (not= (reanimated/get-shared-value btn-opacity) 0)) (js/setTimeout #(reanimated/animate btn-opacity 1) 50))
(reanimated/animate btn-opacity 0) (when (or (not= @z-index 0) (not= (reanimated/get-shared-value btn-opacity) 0))
(js/setTimeout #(when (and (empty? @text-value) (not images?)) (reset! z-index 0)) (reanimated/animate btn-opacity 0)
300)))) (js/setTimeout #(when (and (empty? @text-value) (not images?))
[(and (empty? @text-value) (not images?))]) (reset! z-index 0))
[reanimated/view 300))))
{:style (style/send-button btn-opacity @z-index)} [(and (empty? @text-value) (not images?))])
[quo/button [reanimated/view
{:icon-only? true {:style (style/send-button btn-opacity @z-index)}
:size 32 [quo/button
:accessibility-label :send-message-button {:icon-only? true
:on-press #(send-message props state animations window-height edit)} :size 32
:i/arrow-up]]) :customization-color customization-color
:accessibility-label :send-message-button
:on-press #(send-message props state animations window-height edit)}
:i/arrow-up]]))
(defn send-button (defn send-button
[props {:keys [text-value] :as state} animations window-height images? edit btn-opacity] [props {:keys [text-value] :as state} animations window-height images? edit btn-opacity]