fix: several bugs in 1.25 design feedback (#17548)

This commit is contained in:
yqrashawn 2023-10-06 15:32:33 +08:00 committed by GitHub
parent 933a5a1a9e
commit afbd890a04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 15 deletions

View File

@ -4,7 +4,7 @@
[utils.re-frame :as rf]))
(defn avatar
[public-key size]
[{:keys [public-key size hide-ring?]}]
(let [display-name (first (rf/sub [:contacts/contact-two-names-by-identity public-key]))
photo-path (rf/sub [:chats/photo-path public-key])
online? (rf/sub [:visibility-status-updates/online? public-key])]
@ -14,6 +14,7 @@
:on-press #(rf/dispatch [:chat.ui/show-profile public-key])}
[quo/user-avatar
{:full-name display-name
:ring? (not hide-ring?)
:profile-picture photo-path
:online? online?
:size size}]]]))

View File

@ -31,14 +31,18 @@
(def delivery-state-showing-time-ms 3000)
(defn avatar-container
[{:keys [content last-in-group? pinned-by quoted-message from]} show-reactions? show-user-info?]
[{:keys [content last-in-group? pinned-by quoted-message from]} show-reactions?
in-reaction-and-action-menu? in-pinned-view?]
(if (or (and (seq (:response-to content))
quoted-message)
last-in-group?
pinned-by
(not show-reactions?)
show-user-info?)
[avatar/avatar from :small]
in-reaction-and-action-menu?)
[avatar/avatar
{:public-key from
:size :small
:hide-ring? (or in-pinned-view? in-reaction-and-action-menu?)}]
[rn/view {:padding-top 4 :width 32}]))
(defn author
@ -50,12 +54,12 @@
from
timestamp]}
show-reactions?
show-user-info?]
in-reaction-and-action-menu?]
(when (or (and (seq response-to) quoted-message)
last-in-group?
pinned-by
(not show-reactions?)
show-user-info?)
in-reaction-and-action-menu?)
(let [[primary-name secondary-name] (rf/sub [:contacts/contact-two-names-by-identity from])
{:keys [ens-verified added?]} (rf/sub [:contacts/contact-by-address from])]
[quo/author
@ -111,7 +115,8 @@
(defn- user-message-content-internal
[]
(let [show-delivery-state? (reagent/atom false)]
(fn [{:keys [message-data context keyboard-shown? show-reactions? show-user-info? theme]}]
(fn [{:keys [message-data context keyboard-shown? show-reactions? in-reaction-and-action-menu?
theme]}]
(let [{:keys [content-type quoted-message content
outgoing outgoing-status pinned-by]} message-data
first-image (first (:album message-data))
@ -163,7 +168,8 @@
[rn/view
{:style {:padding-horizontal 4
:flex-direction :row}}
[avatar-container message-data show-reactions? show-user-info?]
[avatar-container message-data show-reactions? in-reaction-and-action-menu?
(:in-pinned-view? context)]
(into
(if show-reactions?
[rn/view]
@ -172,7 +178,7 @@
:flex 1
:max-height (when-not show-reactions?
(* 0.4 height))}}
[author message-data show-reactions? show-user-info?]
[author message-data show-reactions? in-reaction-and-action-menu?]
(condp = content-type
constants/content-type-text
[content.text/text-content message-data context]
@ -218,11 +224,11 @@
:selected-item (fn []
[rn/view {:pointer-events :none}
[user-message-content
{:message-data message-data
:context context
:keyboard-shown? keyboard-shown?
:show-reactions? true
:show-user-info? true}]])}]))
{:message-data message-data
:context context
:keyboard-shown? keyboard-shown?
:show-reactions? true
:in-reaction-and-action-menu? true}]])}]))
(defn system-message?
[content-type]

View File

@ -36,7 +36,7 @@
:background-color :transparent
:height 48
:border-color :black
:border-width 3
:border-width 2
:border-radius 44}))
(def picture-avatar-mask