fix the last message in chat is not tappable if it's close to the composer (#20214)

This commit is contained in:
Parvesh Monu 2024-05-28 21:20:32 +05:30 committed by jo-mut
parent 76c1a9b25e
commit 17d831dace
No known key found for this signature in database
GPG Key ID: 76AE8CD103294A70
2 changed files with 18 additions and 9 deletions

View File

@ -4,7 +4,9 @@
[quo.foundations.typography :as typography] [quo.foundations.typography :as typography]
[react-native.platform :as platform] [react-native.platform :as platform]
[react-native.reanimated :as reanimated] [react-native.reanimated :as reanimated]
[status-im.contexts.chat.messenger.composer.constants :as constants])) [status-im.contexts.chat.messenger.composer.constants :as constants]
[status-im.contexts.shell.jump-to.constants :as shell.constants]
[status-im.feature-flags :as ff]))
(def border-top-radius 20) (def border-top-radius 20)
@ -117,7 +119,14 @@
(reanimated/apply-animations-to-style (reanimated/apply-animations-to-style
{:transform [{:translate-y translate-y}] {:transform [{:translate-y translate-y}]
:opacity opacity} :opacity opacity}
{:z-index 1})) {}))
(defn shell-button-container
[]
{:z-index 1
:top (if (ff/enabled? ::ff/shell.jump-to)
0
(- shell.constants/floating-shell-button-height))})
(def scroll-to-bottom-button (def scroll-to-bottom-button
{:position :absolute {:position :absolute

View File

@ -27,17 +27,17 @@
jump-to-button-position (worklets/jump-to-button-position jump-to-button-position (worklets/jump-to-button-position
scroll-down-button-opacity scroll-down-button-opacity
composer-focused?)] composer-focused?)]
[:<> [rn/view {:style (style/shell-button-container)}
[reanimated/view (when (ff/enabled? ::ff/shell.jump-to)
{:style (style/shell-button jump-to-button-position jump-to-button-opacity)} [reanimated/view
[quo/floating-shell-button {:style (style/shell-button jump-to-button-position jump-to-button-opacity)}
(when (ff/enabled? ::ff/shell.jump-to) [quo/floating-shell-button
{:jump-to {:jump-to
{:on-press #(rf/dispatch [:shell/navigate-to-jump-to]) {:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:customization-color customization-color :customization-color customization-color
:label (i18n/label :t/jump-to) :label (i18n/label :t/jump-to)
:style {:align-self :center}}}) :style {:align-self :center}}}
{}]] {}]])
[quo/floating-shell-button [quo/floating-shell-button
{:scroll-to-bottom {:on-press #(rf/dispatch [:chat.ui/scroll-to-bottom])}} {:scroll-to-bottom {:on-press #(rf/dispatch [:chat.ui/scroll-to-bottom])}}
style/scroll-to-bottom-button style/scroll-to-bottom-button