Skip to content

Commit

Permalink
fix: floating-shell-button (#16030)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajayesivan authored May 29, 2023
1 parent 65eb0af commit 1521186
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/quo2/components/buttons/dynamic_button.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions src/quo2/components/navigation/floating_shell_button.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/status_im2/contexts/chat/composer/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/status_im2/contexts/shell/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1521186

Please sign in to comment.