Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull committed Jun 26, 2023
1 parent 5b6014d commit 1ca949b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/status_im2/subs/shell.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
(first images)))})))

(defn get-card-content
[chat communities group-chat primary-name]
[{:keys [chat communities group-chat? primary-name]}]
(let [{:keys [content-type content deleted? outgoing deleted-for-me?] :as last-message}
(:last-message chat)]
(merge
Expand All @@ -30,7 +30,7 @@
:data {:text
(if (or deleted-for-me? outgoing)
(i18n/label :t/you-deleted-a-message)
(if group-chat
(if (and group-chat? primary-name)
(i18n/label :t/user-deleted-a-message {:user primary-name})
(i18n/label :t/this-message-was-deleted)))}}

Expand Down Expand Up @@ -65,9 +65,7 @@
(let [community (get communities (:community-id last-message))]
{:content-type constants/content-type-community
:data {:avatar (community-avatar community)
:community-name (:name community)}})

:else nil))
:community-name (:name community)}})))
{:new-notifications? (pos? (:unviewed-messages-count chat))
:notification-indicator (if (pos? (:unviewed-mentions-count chat))
:counter
Expand All @@ -83,15 +81,21 @@
:profile-picture (when profile-picture
(str profile-picture "&addRing=0"))}
:customization-color (or (:customization-color contact) :primary)
:content (get-card-content chat communities false nil)
:content (get-card-content
{:chat chat
:communities communities})
:id id}))

(defn private-group-chat-card
[chat id communities primary-name]
{:title (:chat-name chat)
:avatar-params {}
:customization-color (or (:customization-color chat) :primary)
:content (get-card-content chat communities true primary-name)
:content (get-card-content
{:chat chat
:communities communities
:group-chat? true
:primary-name primary-name})
:id id})

(defn community-card
Expand Down

0 comments on commit 1ca949b

Please sign in to comment.