Get community-id from notification data for mentions and replies (#15100)
* [Chore] Get community-id from notification data * [Chore] Updated name for community chat
This commit is contained in:
parent
5cea66647e
commit
488db615c0
|
@ -36,13 +36,11 @@
|
||||||
parsed-text-children))))
|
parsed-text-children))))
|
||||||
|
|
||||||
(defn view
|
(defn view
|
||||||
[{:keys [author chat-name chat-id message read timestamp]}]
|
[{:keys [author chat-name community-id chat-id message read timestamp]}]
|
||||||
(let [chat (rf/sub [:chats/chat chat-id])
|
(let [community-chat? (not (string/blank? community-id))
|
||||||
community-id (:community-id chat)
|
community (rf/sub [:communities/community community-id])
|
||||||
is-chat-from-community? (not (nil? community-id))
|
community-name (:name community)
|
||||||
community (rf/sub [:communities/community community-id])
|
community-image (get-in community [:images :thumbnail :uri])]
|
||||||
community-name (:name community)
|
|
||||||
community-image (get-in community [:images :thumbnail :uri])]
|
|
||||||
[rn/touchable-opacity
|
[rn/touchable-opacity
|
||||||
{:on-press (fn []
|
{:on-press (fn []
|
||||||
(rf/dispatch [:hide-popover])
|
(rf/dispatch [:hide-popover])
|
||||||
|
@ -54,7 +52,7 @@
|
||||||
:unread? (not read)
|
:unread? (not read)
|
||||||
:context [[common/user-avatar-tag author]
|
:context [[common/user-avatar-tag author]
|
||||||
[quo/text {:style style/tag-text} (string/lower-case (i18n/label :t/on))]
|
[quo/text {:style style/tag-text} (string/lower-case (i18n/label :t/on))]
|
||||||
(if is-chat-from-community?
|
(if community-chat?
|
||||||
[quo/context-tag tag-params {:uri community-image} community-name chat-name]
|
[quo/context-tag tag-params {:uri community-image} community-name chat-name]
|
||||||
[quo/group-avatar-tag chat-name tag-params])]
|
[quo/group-avatar-tag chat-name tag-params])]
|
||||||
:message {:body (message-body message)}}]]))
|
:message {:body (message-body message)}}]]))
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
(ns status-im2.contexts.activity-center.notification.reply.view
|
(ns status-im2.contexts.activity-center.notification.reply.view
|
||||||
(:require [quo2.core :as quo]
|
(:require [clojure.string :as string]
|
||||||
|
[quo2.core :as quo]
|
||||||
[quo2.foundations.colors :as colors]
|
[quo2.foundations.colors :as colors]
|
||||||
[react-native.core :as rn]
|
[react-native.core :as rn]
|
||||||
[status-im.ui2.screens.chat.messages.message :as old-message]
|
[status-im.ui2.screens.chat.messages.message :as old-message]
|
||||||
|
@ -37,13 +38,11 @@
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
(defn view
|
(defn view
|
||||||
[{:keys [author chat-name chat-id message read timestamp]}]
|
[{:keys [author chat-name community-id chat-id message read timestamp]}]
|
||||||
(let [chat (rf/sub [:chats/chat chat-id])
|
(let [community-chat? (not (string/blank? community-id))
|
||||||
community-id (:community-id chat)
|
community (rf/sub [:communities/community community-id])
|
||||||
is-chat-from-community? (not (nil? community-id))
|
community-name (:name community)
|
||||||
community (rf/sub [:communities/community community-id])
|
community-image (get-in community [:images :thumbnail :uri])]
|
||||||
community-name (:name community)
|
|
||||||
community-image (get-in community [:images :thumbnail :uri])]
|
|
||||||
[rn/touchable-opacity
|
[rn/touchable-opacity
|
||||||
{:on-press (fn []
|
{:on-press (fn []
|
||||||
(rf/dispatch [:hide-popover])
|
(rf/dispatch [:hide-popover])
|
||||||
|
@ -55,7 +54,7 @@
|
||||||
:unread? (not read)
|
:unread? (not read)
|
||||||
:context [[common/user-avatar-tag author]
|
:context [[common/user-avatar-tag author]
|
||||||
[quo/text {:style style/lowercase-text} (i18n/label :t/on)]
|
[quo/text {:style style/lowercase-text} (i18n/label :t/on)]
|
||||||
(if is-chat-from-community?
|
(if community-chat?
|
||||||
[quo/context-tag tag-params {:uri community-image} community-name chat-name]
|
[quo/context-tag tag-params {:uri community-image} community-name chat-name]
|
||||||
[quo/group-avatar-tag chat-name tag-params])]
|
[quo/group-avatar-tag chat-name tag-params])]
|
||||||
:message {:body-number-of-lines 1
|
:message {:body-number-of-lines 1
|
||||||
|
|
Loading…
Reference in New Issue