[#7451] Stickers support on desktop
Signed-off-by: Andrey Shovkoplyas <motor4ik@gmail.com>
This commit is contained in:
parent
8def565664
commit
448581058c
|
@ -138,7 +138,7 @@
|
|||
[react/text {:style styles/system-message-text}
|
||||
text]]])
|
||||
|
||||
(views/defview message-with-name-and-avatar [text {:keys [from first-in-group? timestamp] :as message}]
|
||||
(defn message-wrapper [{:keys [from first-in-group? timestamp] :as message} item]
|
||||
[react/view
|
||||
(when first-in-group?
|
||||
[react/view {:style {:flex-direction :row :margin-top 24}}
|
||||
|
@ -149,7 +149,10 @@
|
|||
(time/timestamp->time timestamp)]])
|
||||
[react/view {:style styles/not-first-in-group-wrapper}
|
||||
[photo-placeholder]
|
||||
[message-without-timestamp text message]]])
|
||||
item]])
|
||||
|
||||
(views/defview message-with-name-and-avatar [text message]
|
||||
[message-wrapper message [message-without-timestamp text message]])
|
||||
|
||||
(defmulti message (fn [_ _ {:keys [content-type]}] content-type))
|
||||
|
||||
|
@ -164,6 +167,12 @@
|
|||
[react/view {:style styles/message-command-container}
|
||||
[message/message-content-command message]]]])
|
||||
|
||||
(defmethod message constants/content-type-sticker
|
||||
[_ _ {:keys [content] :as message}]
|
||||
[message-wrapper message
|
||||
[react/image {:style {:margin 10 :width 140 :height 140}
|
||||
:source {:uri (:uri content)}}]])
|
||||
|
||||
(views/defview message-content-status [text message]
|
||||
[react/view
|
||||
[system-message text message]])
|
||||
|
|
|
@ -54,13 +54,16 @@
|
|||
:number-of-lines 1
|
||||
:style (styles/chat-name current?)}
|
||||
name]]
|
||||
[react/text {:ellipsize-mode :tail
|
||||
:number-of-lines 1
|
||||
:style styles/chat-last-message}
|
||||
(if (= constants/content-type-command (:content-type last-message))
|
||||
[chat-item/command-short-preview last-message]
|
||||
(or (:text last-message-content)
|
||||
(i18n/label :no-messages-yet)))]]
|
||||
(if (and (:uri (:content last-message) (= constants/content-type-sticker (:content-type last-message))))
|
||||
[react/image {:style {:margin 2 :width 30 :height 30}
|
||||
:source {:uri (:uri (:content last-message))}}]
|
||||
[react/text {:ellipsize-mode :tail
|
||||
:number-of-lines 1
|
||||
:style styles/chat-last-message}
|
||||
(if (= constants/content-type-command (:content-type last-message))
|
||||
[chat-item/command-short-preview last-message]
|
||||
(or (:text last-message-content)
|
||||
(i18n/label :no-messages-yet)))])]
|
||||
[react/view {:style styles/timestamp}
|
||||
[chat-item/message-timestamp (:timestamp last-message)]
|
||||
(when (pos? unviewed-messages-count)
|
||||
|
|
Loading…
Reference in New Issue