fix: deleted-by user name style (#15218)

This commit is contained in:
yqrashawn 2023-03-01 15:03:27 +08:00 committed by GitHub
parent b72f0d4702
commit 2ce4a820d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 25 deletions

View File

@ -3,8 +3,8 @@
[quo2.components.icon :as icons] [quo2.components.icon :as icons]
[quo2.components.markdown.text :as text] [quo2.components.markdown.text :as text]
[quo2.components.messages.author.style :as style] [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 "·") (def middle-dot "·")
@ -15,20 +15,23 @@
[rn/view {:style style/container} [rn/view {:style style/container}
[:<> [:<>
[text/text [text/text
{:weight :semi-bold {:weight :semi-bold
:size :paragraph-2 :size :paragraph-2
:style {:color (colors/theme-colors colors/neutral-100 colors/white)}} :number-of-lines 1
:style {:color (colors/theme-colors colors/neutral-100 colors/white)}}
primary-name] primary-name]
(when (not (string/blank? secondary-name)) (when (not (string/blank? secondary-name))
[:<> [:<>
[text/text [text/text
{:size :paragraph-2 {:size :paragraph-2
:style style/middle-dot-nickname} :number-of-lines 1
:style style/middle-dot-nickname}
middle-dot] middle-dot]
[text/text [text/text
{:weight :medium {:weight :medium
:size :paragraph-2 :size :paragraph-2
:style {:color (colors/theme-colors colors/neutral-60 colors/neutral-40)}} :number-of-lines 1
:style {:color (colors/theme-colors colors/neutral-60 colors/neutral-40)}}
secondary-name]])] secondary-name]])]
(when contact? (when contact?
[icons/icon :main-icons2/contact [icons/icon :main-icons2/contact
@ -46,21 +49,25 @@
{:size 12 {:size 12
:no-color true :no-color true
:container-style style/icon-container}]) :container-style style/icon-container}])
(when-not verified? (when (and (not verified?) short-chat-key)
[text/text [text/text
{:monospace true {:monospace true
:size :paragraph-2 :size :paragraph-2
:style style/chat-key-text} :number-of-lines 1
:style style/chat-key-text}
short-chat-key]) short-chat-key])
(when (and (not verified?) time-str) (when (and (not verified?) time-str)
[text/text [text/text
{:monospace true {:monospace true
:size :paragraph-2 :size :paragraph-2
:style style/middle-dot-chat-key} :number-of-lines 1
:style style/middle-dot-chat-key}
middle-dot]) middle-dot])
[text/text (when time-str
{:monospace true [text/text
:size :paragraph-2 {:monospace true
:accessibility-label :message-timestamp :size :paragraph-2
:style (style/time-text verified?)} :accessibility-label :message-timestamp
time-str]])]) :number-of-lines 1
:style (style/time-text verified?)}
time-str])])])

View File

@ -7,7 +7,11 @@
(defn user-xxx-deleted-this-message (defn user-xxx-deleted-this-message
[{:keys [display-name profile-picture]}] [{: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}} [rn/view {:style {:margin-right 4}}
[quo/user-avatar [quo/user-avatar
{:full-name display-name {:full-name display-name
@ -16,7 +20,10 @@
:ring? false :ring? false
:size :xxxs}]] :size :xxxs}]]
[quo/author {:primary-name display-name}] [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)]]) (i18n/label :t/deleted-this-message)]])
(defn- compute-on-long-press-fn (defn- compute-on-long-press-fn