Add jump-to button to community-overview screen (#15003)

This commit is contained in:
Parvesh Monu 2023-02-08 16:13:14 +05:30 committed by GitHub
parent 0c59ed5ceb
commit bf932e6825
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 11 deletions

View File

@ -12,7 +12,7 @@
(into [rn/touchable-opacity (into [rn/touchable-opacity
{:on-press (fn [] {:on-press (fn []
(rf/dispatch [:hide-popover]) (rf/dispatch [:hide-popover])
(rf/dispatch [:chat.ui/navigate-to-chat-nav2 chat-id]))}] (rf/dispatch [:chat/navigate-to-chat chat-id]))}]
children) children)
(into [:<>] children))) (into [:<>] children)))

View File

@ -172,7 +172,7 @@
;; used here. ;; used here.
(when (and community-id (not navigate-to-shell?)) (when (and community-id (not navigate-to-shell?))
{:dispatch-n [[:shell/add-switcher-card {:dispatch-n [[:shell/add-switcher-card
:community {:community-id community-id}]]}))) :community-overview community-id]]})))
(delete-for-me/sync-all) (delete-for-me/sync-all)
(delete-message/send-all) (delete-message/send-all)
(offload-messages chat-id)))) (offload-messages chat-id))))

View File

@ -30,7 +30,7 @@
(let [community (rf/sub [:communities/home-item id])] (let [community (rf/sub [:communities/home-item id])]
^{:key index} ^{:key index}
[quo/communities-membership-list-item [quo/communities-membership-list-item
{:on-press #(rf/dispatch [:navigate-to :community-overview id]) {:on-press #(rf/dispatch [:navigate-to-nav2 :community-overview id])
:on-long-press #(rf/dispatch :on-long-press #(rf/dispatch
[:bottom-sheet/show-sheet [:bottom-sheet/show-sheet
{:content (fn [] {:content (fn []

View File

@ -11,6 +11,7 @@
[status-im2.contexts.communities.overview.style :as style] [status-im2.contexts.communities.overview.style :as style]
[status-im2.contexts.communities.menus.community-options.view :as options] [status-im2.contexts.communities.menus.community-options.view :as options]
[status-im2.contexts.communities.menus.request-to-join.view :as join-menu] [status-im2.contexts.communities.menus.request-to-join.view :as join-menu]
[quo2.components.navigation.floating-shell-button :as floating-shell-button]
[status-im2.contexts.communities.overview.utils :as utils] [status-im2.contexts.communities.overview.utils :as utils]
[utils.re-frame :as rf])) [utils.re-frame :as rf]))
@ -318,4 +319,9 @@
community (rf/sub [:communities/community id])] community (rf/sub [:communities/community id])]
[rn/view [rn/view
{:style style/community-overview-container} {:style style/community-overview-container}
[community-card-page-view community]])) [community-card-page-view community]
[floating-shell-button/floating-shell-button
{:jump-to {:on-press #(rf/dispatch [:shell/navigate-to-jump-to])
:label (i18n/label :t/jump-to)}}
{:position :absolute
:bottom 41}]]))

View File

@ -72,13 +72,13 @@
nil)) nil))
:community :community-overview
{:navigate-from :communities-stack {:navigate-from :communities-stack
:card-id (:community-id id) :card-id id
:switcher-card {:type shell.constants/community-card :switcher-card {:type shell.constants/community-card
:card-id (:community-id id) :card-id id
:clock now :clock now
:screen-id (:community-id id)}} :screen-id id}}
nil)) nil))
(rf/defn add-switcher-card (rf/defn add-switcher-card

View File

@ -90,8 +90,7 @@
{:name (:name community)}) {:name (:name community)})
:customization-color (or (:customization-color community) :primary) :customization-color (or (:customization-color community) :primary)
:on-close #(re-frame/dispatch [:shell/close-switcher-card id]) :on-close #(re-frame/dispatch [:shell/close-switcher-card id])
:on-press #(re-frame/dispatch [:navigate-to-nav2 :community :on-press #(re-frame/dispatch [:navigate-to-nav2 :community-overview id true])
{:community-id id} true])
:content {:community-info {:type :permission}}})) :content {:community-info {:type :permission}}}))
(defn community-channel-card (defn community-channel-card
@ -101,7 +100,7 @@
{:content {:community-channel {:emoji (:emoji channel) {:content {:community-channel {:emoji (:emoji channel)
:channel-name (str "# " (:name channel))}} :channel-name (str "# " (:name channel))}}
:on-press (fn [] :on-press (fn []
(re-frame/dispatch [:navigate-to-nav2 :community {:community-id community-id}]) (re-frame/dispatch [:navigate-to-nav2 :community-overview community-id true])
(js/setTimeout (js/setTimeout
#(re-frame/dispatch [:chat/navigate-to-chat channel-id true]) #(re-frame/dispatch [:chat/navigate-to-chat channel-id true])
100))})) 100))}))