Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pinned message drawer issues #19693

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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}])]))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)})
Expand Down
10 changes: 6 additions & 4 deletions src/status_im/contexts/chat/messenger/messages/content/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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?}])]))