From 2ce4a820d783427ce847a485538ffb59db7d13b0 Mon Sep 17 00:00:00 2001 From: yqrashawn Date: Wed, 1 Mar 2023 15:03:27 +0800 Subject: [PATCH] fix: deleted-by user name style (#15218) --- src/quo2/components/messages/author/view.cljs | 53 +++++++++++-------- .../chat/messages/content/deleted/view.cljs | 11 +++- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/quo2/components/messages/author/view.cljs b/src/quo2/components/messages/author/view.cljs index 2beded316d..6ad0e1d7ea 100644 --- a/src/quo2/components/messages/author/view.cljs +++ b/src/quo2/components/messages/author/view.cljs @@ -3,8 +3,8 @@ [quo2.components.icon :as icons] [quo2.components.markdown.text :as text] [quo2.components.messages.author.style :as style] - [react-native.core :as rn] - [quo2.foundations.colors :as colors])) + [quo2.foundations.colors :as colors] + [react-native.core :as rn])) (def middle-dot "ยท") @@ -15,20 +15,23 @@ [rn/view {:style style/container} [:<> [text/text - {:weight :semi-bold - :size :paragraph-2 - :style {:color (colors/theme-colors colors/neutral-100 colors/white)}} + {:weight :semi-bold + :size :paragraph-2 + :number-of-lines 1 + :style {:color (colors/theme-colors colors/neutral-100 colors/white)}} primary-name] (when (not (string/blank? secondary-name)) [:<> [text/text - {:size :paragraph-2 - :style style/middle-dot-nickname} + {:size :paragraph-2 + :number-of-lines 1 + :style style/middle-dot-nickname} middle-dot] [text/text - {:weight :medium - :size :paragraph-2 - :style {:color (colors/theme-colors colors/neutral-60 colors/neutral-40)}} + {:weight :medium + :size :paragraph-2 + :number-of-lines 1 + :style {:color (colors/theme-colors colors/neutral-60 colors/neutral-40)}} secondary-name]])] (when contact? [icons/icon :main-icons2/contact @@ -46,21 +49,25 @@ {:size 12 :no-color true :container-style style/icon-container}]) - (when-not verified? + (when (and (not verified?) short-chat-key) [text/text - {:monospace true - :size :paragraph-2 - :style style/chat-key-text} + {:monospace true + :size :paragraph-2 + :number-of-lines 1 + :style style/chat-key-text} short-chat-key]) (when (and (not verified?) time-str) [text/text - {:monospace true - :size :paragraph-2 - :style style/middle-dot-chat-key} + {:monospace true + :size :paragraph-2 + :number-of-lines 1 + :style style/middle-dot-chat-key} middle-dot]) - [text/text - {:monospace true - :size :paragraph-2 - :accessibility-label :message-timestamp - :style (style/time-text verified?)} - time-str]])]) + (when time-str + [text/text + {:monospace true + :size :paragraph-2 + :accessibility-label :message-timestamp + :number-of-lines 1 + :style (style/time-text verified?)} + time-str])])]) diff --git a/src/status_im2/contexts/chat/messages/content/deleted/view.cljs b/src/status_im2/contexts/chat/messages/content/deleted/view.cljs index 3aa2417877..b694028912 100644 --- a/src/status_im2/contexts/chat/messages/content/deleted/view.cljs +++ b/src/status_im2/contexts/chat/messages/content/deleted/view.cljs @@ -7,7 +7,11 @@ (defn user-xxx-deleted-this-message [{:keys [display-name profile-picture]}] - [rn/view {:style {:flex-direction :row :align-items :center :flex 1 :flex-wrap :wrap}} + [rn/view + {:style {:flex-direction :row + :align-items :center + :flex 1 + :flex-wrap :wrap}} [rn/view {:style {:margin-right 4}} [quo/user-avatar {:full-name display-name @@ -16,7 +20,10 @@ :ring? false :size :xxxs}]] [quo/author {:primary-name display-name}] - [quo/text {:style {:margin-left 4} :size :paragraph-2} + [quo/text + {:style {:margin-left 4} + :size :paragraph-2 + :number-of-lines 1} (i18n/label :t/deleted-this-message)]]) (defn- compute-on-long-press-fn