feat: add jump-to button in group-detail screen (#19134)

This commit is contained in:
codemaster 2024-03-19 07:06:06 -07:00 committed by GitHub
parent 27407b9cbb
commit 2ee7db9370
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 4 deletions

View File

@ -40,3 +40,6 @@
:background-color (colors/theme-colors colors/white colors/neutral-95-opa-70)
:flex-direction :row})
(def floating-shell-button
{:position :absolute
:bottom 21})

View File

@ -113,6 +113,7 @@
members (rf/sub [:contacts/group-members-sections chat-id])
pinned-messages (rf/sub [:chats/pinned chat-id])
current-pk (rf/sub [:multiaccount/public-key])
profile-color (rf/sub [:profile/customization-color])
admin? (get admins current-pk)]
[:<>
[quo/gradient-cover
@ -127,7 +128,6 @@
group])}])}]
:icon-name :i/arrow-left
:on-press #(rf/dispatch [:navigate-back])}]
[quo/page-top
{:title chat-name
:avatar {:customization-color color}}]
@ -167,4 +167,12 @@
:render-section-footer-fn contacts-section-footer
:render-data {:chat-id chat-id
:admin? admin?}
:render-fn contact-item-render}]]))
:render-fn contact-item-render}]
[quo/floating-shell-button
{:jump-to {:on-press (fn []
(rf/dispatch [:navigate-back])
(rf/dispatch [:shell/navigate-to-jump-to])
)
:customization-color profile-color
:label (i18n/label :t/jump-to)}}
style/floating-shell-button]]))

View File

@ -70,8 +70,7 @@
:on-scroll #(scroll-handler % scroll-y)
:bounces false}]
[quo/floating-shell-button
{:key :shell
:jump-to
{:jump-to
{:on-press (fn []
(rf/dispatch [:navigate-back])
(debounce/throttle-and-dispatch [:shell/navigate-to-jump-to] 500))