Skip to content

Commit

Permalink
Fix for "Jump to" button overlapping Logout button on the Profile scr…
Browse files Browse the repository at this point in the history
…een (#19318)

* Fix for "Jump to" button overlapping Logout button on the Profile screen

* Fix for offsets

* Code style

* Fixes
  • Loading branch information
alwx authored Mar 21, 2024
1 parent 1e37765 commit 51541f7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
26 changes: 20 additions & 6 deletions src/status_im/contexts/profile/settings/style.cljs
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
(ns status-im.contexts.profile.settings.style
(:require [quo.foundations.colors :as colors]))
(:require [quo.foundations.colors :as colors]
[react-native.platform :as platform]
[status-im.contexts.shell.jump-to.constants :as jump-to.constants]))

(defn navigation-wrapper
[{:keys [customization-color inset theme]}]
{:padding-top inset
:background-color (colors/resolve-color customization-color theme 40)})

(def footer-container
{:margin-top 8
:margin-bottom 50
:padding-horizontal 20
:padding-vertical 12})
(def ^:const footer-padding 20)
(def ^:const ios-bottom-offset -10)

(defn footer-container
[bottom]
{:padding-horizontal footer-padding
:padding-top footer-padding
:padding-bottom (+ jump-to.constants/floating-shell-button-height
footer-padding
(if platform/ios? ios-bottom-offset bottom))})

(defn floating-shell-button-style
[{:keys [bottom]}]
{:position :absolute
:bottom (if platform/ios?
(+ bottom ios-bottom-offset)
0)})
10 changes: 4 additions & 6 deletions src/status_im/contexts/profile/settings/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
[status-im.contexts.profile.settings.header.view :as settings.header]
[status-im.contexts.profile.settings.list-items :as settings.items]
[status-im.contexts.profile.settings.style :as style]
[status-im.contexts.shell.jump-to.constants :as jump-to.constants]
[utils.debounce :as debounce]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
Expand All @@ -29,9 +28,9 @@
(reanimated/set-shared-value scroll-y current-y)))

(defn- footer
[logout-press]
[{:keys [bottom]} logout-press]
[rf/delay-render
[rn/view {:style style/footer-container}
[rn/view {:style (style/footer-container bottom)}
[quo/logout-button {:on-press logout-press}]]])

(defn- get-item-layout
Expand Down Expand Up @@ -65,7 +64,7 @@
:shows-vertical-scroll-indicator false
:render-fn settings-item-view
:get-item-layout get-item-layout
:footer [footer logout-press]
:footer [footer insets logout-press]
:scroll-event-throttle 16
:on-scroll #(scroll-handler % scroll-y)
:bounces false}]
Expand All @@ -77,8 +76,7 @@
(debounce/throttle-and-dispatch [:shell/navigate-to-jump-to] 500))
:customization-color customization-color
:label (i18n/label :t/jump-to)}}
{:position :absolute
:bottom jump-to.constants/floating-shell-button-height}]]))
(style/floating-shell-button-style insets)]]))

(defn- internal-view
[props]
Expand Down

0 comments on commit 51541f7

Please sign in to comment.