Hide placeholder timestamp with opacity

Fixes #11084

Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
This commit is contained in:
Gheorghe Pinzaru 2020-08-21 14:06:47 +03:00
parent 151ef4a952
commit 8d8057036a
No known key found for this signature in database
GPG Key ID: C9A094959935A952
2 changed files with 5 additions and 8 deletions

View File

@ -124,11 +124,11 @@
acc))
(defn render-parsed-text [message tree]
(reduce (fn [acc e] (render-block message acc e)) [react/view {}] tree))
(reduce (fn [acc e] (render-block message acc e)) [:<>] tree))
(defn render-parsed-text-with-timestamp [{:keys [timestamp-str outgoing] :as message} tree]
(defn render-parsed-text-with-timestamp [{:keys [timestamp-str] :as message} tree]
(let [elements (render-parsed-text message tree)
timestamp [react/text {:style (style/message-timestamp-placeholder outgoing)}
timestamp [react/text {:style (style/message-timestamp-placeholder)}
(str " " timestamp-str)]
last-element (peek elements)]
;; Using `nth` here as slightly faster than `first`, roughly 30%

View File

@ -32,11 +32,8 @@
:align-self :flex-end})
(defn message-timestamp-placeholder
[outgoing]
(assoc message-timestamp
:color (if outgoing
colors/blue
colors/blue-light)))
[]
(merge message-timestamp {:opacity 0}))
(defn message-timestamp-text
[justify-timestamp? outgoing rtl?]