Compare commits

...
4 changed files with 26 additions and 19 deletions
@@ -59,12 +59,15 @@
:channel-name (:chat-name current-chat)}])]
(if (pos? (count pinned))
[rn/flat-list
{:data pinned
:render-data (assoc render-data :disable-message-long-press? disable-message-long-press?)
:render-fn message-render-fn
:footer [rn/view {:style style/list-footer}]
:key-fn list-key-fn
:separator [quo/separator {:style {:margin-vertical 8}}]}]
{:data pinned
:render-data (assoc render-data
:disable-message-long-press?
disable-message-long-press?)
:render-fn message-render-fn
:footer [rn/view {:style style/list-footer}]
:content-container-style {:padding-top 8}
:key-fn list-key-fn
:separator [quo/separator {:style {:margin-vertical 8}}]}]
[empty-pinned-messages-state
{:theme theme}])]))
@@ -2,6 +2,7 @@
(:require
[quo.core :as quo]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[status-im.constants :as constants]
[status-im.contexts.chat.messenger.messages.drawers.view :as drawers]
[utils.re-frame :as rf]))
@@ -54,7 +55,7 @@
(defn- view-internal
[{:keys [message-id chat-id pinned-by preview? theme]} user-message-content]
(let [reactions (rf/sub [:chats/message-reactions message-id chat-id])]
[:<>
[rn/view {:style {:padding-bottom 12}}
(when (seq reactions)
[quo/react
{:container-style {:margin-left 44
@@ -16,16 +16,17 @@
(assoc :margin-top 4)))
(defn user-message-content
[{:keys [outgoing outgoing-status six-reactions? window-scale small-screen?]}]
[{:keys [outgoing outgoing-status six-reactions? window-scale small-screen? in-pinned-view?]}]
{:border-radius 16
:padding-horizontal 8
:padding-top 4
:padding-bottom (if (or small-screen?
(and
(> 3 window-scale)
six-reactions?))
(* message-padding-scaling-ratio window-scale)
4)
:padding-top (if in-pinned-view? 8 4)
:padding-bottom (if in-pinned-view?
5
(when (or small-screen?
(and
(> 3 window-scale)
six-reactions?))
(* message-padding-scaling-ratio window-scale)))
:opacity (if (and outgoing (= outgoing-status :sending))
0.5
1)})
@@ -152,7 +152,7 @@
[]
(let [show-delivery-state? (reagent/atom false)]
(fn [{:keys [message-data context keyboard-shown? show-reactions? in-reaction-and-action-menu?
show-user-info? preview? theme]}]
show-user-info? preview? in-pinned-view? theme]}]
(let [{:keys [content-type quoted-message content outgoing outgoing-status pinned-by pinned
last-in-group? message-id chat-id]} message-data
{:keys [disable-message-long-press?]} context
@@ -195,7 +195,8 @@
:outgoing-status outgoing-status
:small-screen? rn/small-screen?
:window-scale window-scale
:six-reactions? six-reactions?})
:six-reactions? six-reactions?
:in-pinned-view? in-pinned-view?})
:on-press (fn []
(if (and platform/ios? keyboard-shown?)
(do
@@ -259,7 +260,7 @@
(when @show-delivery-state?
[status/status outgoing-status])])]
(when show-reactions?
(when (and show-reactions? (seq reactions))
[reactions/message-reactions-row (assoc message-data :preview? preview?)
[rn/view {:pointer-events :none}
[user-message-content-internal
@@ -337,4 +338,5 @@
{:message-data message-data
:context context
:keyboard-shown? keyboard-shown?
:show-reactions? true}])]))
:show-reactions? true
:in-pinned-view? in-pinned-view?}])]))