From 15211865fb11028ab2bf2b052288489051906727 Mon Sep 17 00:00:00 2001 From: Ajay Sivan Date: Mon, 29 May 2023 09:40:21 -0700 Subject: [PATCH] fix: floating-shell-button (#16030) --- src/quo2/components/buttons/dynamic_button.cljs | 3 ++- src/quo2/components/navigation/floating_shell_button.cljs | 8 ++++++-- src/status_im2/contexts/chat/composer/utils.cljs | 2 +- src/status_im2/contexts/shell/view.cljs | 3 +-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/quo2/components/buttons/dynamic_button.cljs b/src/quo2/components/buttons/dynamic_button.cljs index 665567bf2f..b50da5f763 100644 --- a/src/quo2/components/buttons/dynamic_button.cljs +++ b/src/quo2/components/buttons/dynamic_button.cljs @@ -68,7 +68,8 @@ :on-press-out #(reset! pressed? false) :on-press on-press :active-opacity 1 - :style {:padding 5} + :hit-slop {:top 5 :bottom 5 :left 5 :right 5} + :pointer-events :auto :accessibility-label type} [rn/view {:style (merge diff --git a/src/quo2/components/navigation/floating_shell_button.cljs b/src/quo2/components/navigation/floating_shell_button.cljs index fbbf065c58..95487654eb 100644 --- a/src/quo2/components/navigation/floating_shell_button.cljs +++ b/src/quo2/components/navigation/floating_shell_button.cljs @@ -14,6 +14,10 @@ :style style :customization-color customization-color}])) +(defn- section + [children] + [rn/view {:style {:flex 1} :pointer-events :box-none} children]) + (defn- f-floating-shell-button [dynamic-buttons style opacity-anim] (let [original-style (merge {:flex-direction :row @@ -27,14 +31,14 @@ original-style)] [reanimated/view {:style animated-style} ;; Left Section - [rn/view {:style {:flex 1}} + [section [dynamic-button-view :search dynamic-buttons {:position :absolute :right 8}]] ;; Mid Section (jump-to) [dynamic-button-view :jump-to dynamic-buttons nil] ;; Right Section - [rn/view {:style {:flex 1}} + [section [rn/view {:style {:position :absolute :flex-direction :row diff --git a/src/status_im2/contexts/chat/composer/utils.cljs b/src/status_im2/contexts/chat/composer/utils.cljs index d218488343..a3505eb917 100644 --- a/src/status_im2/contexts/chat/composer/utils.cljs +++ b/src/status_im2/contexts/chat/composer/utils.cljs @@ -114,7 +114,7 @@ (defn calc-shell-neg-y [insets maximized? extra-height] - (let [padding 6 + (let [padding 12 neg-y (if @maximized? -50 0)] (- (+ constants/bar-container-height constants/actions-container-height diff --git a/src/status_im2/contexts/shell/view.cljs b/src/status_im2/contexts/shell/view.cljs index d3dcf13804..774f49c18b 100644 --- a/src/status_im2/contexts/shell/view.cljs +++ b/src/status_im2/contexts/shell/view.cljs @@ -129,8 +129,7 @@ :label (i18n/label :t/jump-to) :customization-color customization-color}} {:position :absolute - :bottom (+ (shell.constants/bottom-tabs-container-height) 7)} ;; bottom offset is 12 = 7 + - ;; 5(padding on button) + :bottom (+ (shell.constants/bottom-tabs-container-height) 12)} (:home-stack-opacity shared-values)]])) (defn shell-stack