From d35dbff04489bfd77d67334e89dbde76e2a6a600 Mon Sep 17 00:00:00 2001 From: BalogunofAfrica <45393944+BalogunofAfrica@users.noreply.github.com> Date: Fri, 1 Sep 2023 10:47:21 +0100 Subject: [PATCH] fix: use custom color for send button (#17146) --- .../contexts/chat/composer/actions/view.cljs | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/status_im2/contexts/chat/composer/actions/view.cljs b/src/status_im2/contexts/chat/composer/actions/view.cljs index e1dd29859f..ba8e5ab060 100644 --- a/src/status_im2/contexts/chat/composer/actions/view.cljs +++ b/src/status_im2/contexts/chat/composer/actions/view.cljs @@ -45,24 +45,27 @@ [props {:keys [text-value] :as state} animations window-height images? btn-opacity z-index edit] - (rn/use-effect (fn [] - (if (or (seq @text-value) images?) - (when (or (not= @z-index 1) (not= (reanimated/get-shared-value btn-opacity) 1)) - (reset! z-index 1) - (js/setTimeout #(reanimated/animate btn-opacity 1) 50)) - (when (or (not= @z-index 0) (not= (reanimated/get-shared-value btn-opacity) 0)) - (reanimated/animate btn-opacity 0) - (js/setTimeout #(when (and (empty? @text-value) (not images?)) (reset! z-index 0)) - 300)))) - [(and (empty? @text-value) (not images?))]) - [reanimated/view - {:style (style/send-button btn-opacity @z-index)} - [quo/button - {:icon-only? true - :size 32 - :accessibility-label :send-message-button - :on-press #(send-message props state animations window-height edit)} - :i/arrow-up]]) + (let [customization-color (rf/sub [:profile/customization-color])] + (rn/use-effect (fn [] + (if (or (seq @text-value) images?) + (when (or (not= @z-index 1) (not= (reanimated/get-shared-value btn-opacity) 1)) + (reset! z-index 1) + (js/setTimeout #(reanimated/animate btn-opacity 1) 50)) + (when (or (not= @z-index 0) (not= (reanimated/get-shared-value btn-opacity) 0)) + (reanimated/animate btn-opacity 0) + (js/setTimeout #(when (and (empty? @text-value) (not images?)) + (reset! z-index 0)) + 300)))) + [(and (empty? @text-value) (not images?))]) + [reanimated/view + {:style (style/send-button btn-opacity @z-index)} + [quo/button + {:icon-only? true + :size 32 + :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 [props {:keys [text-value] :as state} animations window-height images? edit btn-opacity]