From ff1ae2f4aadee24af124a343677fabce5487a59d Mon Sep 17 00:00:00 2001 From: Parvesh Monu Date: Tue, 8 Aug 2023 18:34:36 +0530 Subject: [PATCH] Add fallback letter on channel on the community card (#16863) --- src/quo2/components/avatars/channel_avatar/view.cljs | 5 +++-- .../shell/jump_to/components/switcher_cards/view.cljs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/quo2/components/avatars/channel_avatar/view.cljs b/src/quo2/components/avatars/channel_avatar/view.cljs index cdd3034972..15e56275a6 100644 --- a/src/quo2/components/avatars/channel_avatar/view.cljs +++ b/src/quo2/components/avatars/channel_avatar/view.cljs @@ -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] diff --git a/src/status_im2/contexts/shell/jump_to/components/switcher_cards/view.cljs b/src/status_im2/contexts/shell/jump_to/components/switcher_cards/view.cljs index 6968c42c6e..848a391786 100644 --- a/src/status_im2/contexts/shell/jump_to/components/switcher_cards/view.cljs +++ b/src/status_im2/contexts/shell/jump_to/components/switcher_cards/view.cljs @@ -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