Add fallback letter on channel on the community card (#16863)

This commit is contained in:
Parvesh Monu 2023-08-08 18:34:36 +05:30 committed by GitHub
parent 2869edafdd
commit ff1ae2f4aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -9,13 +9,14 @@
(defn- initials
[full-name size color]
(let [amount-initials (if (= size :size/l) 2 1)]
(let [amount-initials (if (= size :size/l) 2 1)
channel-name (string/replace full-name "#" "")]
[text/text
{:accessibility-label :initials
:size :paragraph-2
:weight :semi-bold
:style {:color color}}
(utils.string/get-initials full-name amount-initials)]))
(utils.string/get-initials channel-name amount-initials)]))
(defn- lock
[locked? size]

View File

@ -14,10 +14,11 @@
[status-im2.contexts.chat.messages.resolver.message-resolver :as resolver]))
(defn- channel-card
[{:keys [emoji channel-name customization-color] :as _community-channel}]
[{:keys [emoji channel-name customization-color]}]
[rn/view style/channel-card-container
[quo/channel-avatar
{:emoji emoji
:full-name channel-name
:customization-color customization-color}]
[rn/view style/channel-card-text-container
[quo/text