Skip to content

Commit

Permalink
Merge branch 'develop' into 17576
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrkhalil authored Dec 4, 2023
2 parents 1868bfb + a7178a4 commit 1804c7e
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 24 deletions.
4 changes: 3 additions & 1 deletion src/status_im2/contexts/communities/overview/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,11 @@

(defn community-card-page-view
[id]
(let [{:keys [id]
(let [{:keys [id joined]
:as community} (rf/sub [:communities/community id])
pending? (rf/sub [:communities/my-pending-request-to-join id])]
(when joined
(rf/dispatch [:activity-center.notifications/dismiss-community-overview id]))
[community-scroll-page community pending?]))

(defn overview
Expand Down
6 changes: 6 additions & 0 deletions src/status_im2/contexts/shell/activity_center/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@
:utils/dispatch-later [{:dispatch [:activity-center.notifications/mark-all-as-read]
:ms undo-time-limit-ms}]}))

(re-frame/reg-event-fx :activity-center.notifications/dismiss-community-overview
(fn [_ [community-id]]
{:json-rpc/call [{:method "wakuext_dismissActivityCenterNotificationsByCommunity"
:params [{:communityId community-id}]
:on-success [:activity-center.notifications/fetch-unread-count]}]}))

(rf/defn accept-notification
{:events [:activity-center.notifications/accept]}
[{:keys [db]} notification-id]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns status-im2.contexts.shell.activity-center.notification.community-kicked.view
(:require
[quo.core :as quo]
[react-native.gesture :as gesture]
[status-im2.contexts.shell.activity-center.notification.common.style :as common-style]
[status-im2.contexts.shell.activity-center.notification.common.view :as common]
[utils.datetime :as datetime]
Expand All @@ -26,18 +27,22 @@
community-name (:name community)
community-image (get-in community [:images :thumbnail :uri])]
[swipeable props
[quo/activity-log
{:title (i18n/label :t/community-kicked-heading)
:customization-color customization-color
:icon :i/placeholder
:on-layout set-swipeable-height
:timestamp (datetime/timestamp->relative timestamp)
:unread? (not read)
:context [[quo/text {:style common-style/user-avatar-tag-text}
(i18n/label :t/community-kicked-body)]
[quo/context-tag
{:type :community
:size 24
:blur? true
:community-logo community-image
:community-name community-name}]]}]]))
[gesture/touchable-without-feedback
{:on-press (fn []
(rf/dispatch [:navigate-back])
(rf/dispatch [:activity-center.notifications/mark-as-read (:id notification)]))}
[quo/activity-log
{:title (i18n/label :t/community-kicked-heading)
:customization-color customization-color
:icon :i/placeholder
:on-layout set-swipeable-height
:timestamp (datetime/timestamp->relative timestamp)
:unread? (not read)
:context [[quo/text {:style common-style/user-avatar-tag-text}
(i18n/label :t/community-kicked-body)]
[quo/context-tag
{:type :community
:size 24
:blur? true
:community-logo community-image
:community-name community-name}]]}]]]))
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns status-im2.contexts.shell.activity-center.notification.community-request.view
(:require
[quo.core :as quo]
[react-native.gesture :as gesture]
[status-im2.constants :as constants]
[status-im2.contexts.shell.activity-center.notification.common.style :as common-style]
[status-im2.contexts.shell.activity-center.notification.common.view :as common]
Expand Down Expand Up @@ -67,11 +68,15 @@
{:keys [header-text context]} (get-header-text-and-context community
membership-status)]
[swipeable props
[quo/activity-log
{:title header-text
:customization-color customization-color
:icon :i/communities
:on-layout set-swipeable-height
:timestamp (datetime/timestamp->relative timestamp)
:unread? (not read)
:context context}]]))
[gesture/touchable-without-feedback
{:on-press (fn []
(rf/dispatch [:navigate-back])
(rf/dispatch [:navigate-to :community-overview community-id]))}
[quo/activity-log
{:title header-text
:customization-color customization-color
:icon :i/communities
:on-layout set-swipeable-height
:timestamp (datetime/timestamp->relative timestamp)
:unread? (not read)
:context context}]]]))

0 comments on commit 1804c7e

Please sign in to comment.