fix: reaction drawer issue (#19754)

This commit is contained in:
codemaster 2024-04-29 06:00:19 -07:00 committed by GitHub
parent bd192b0f7d
commit d9aa885eb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 15 deletions

View File

@ -16,16 +16,18 @@
(assoc :margin-top 4))) (assoc :margin-top 4)))
(defn user-message-content (defn user-message-content
[{:keys [outgoing outgoing-status six-reactions? window-scale small-screen?]}] [{:keys [outgoing outgoing-status six-reactions? window-scale small-screen? preview?]}]
{:border-radius 16 {:border-radius 16
:padding-horizontal 8 :padding-horizontal (if preview? 12 8)
:padding-top 4 :padding-top (if preview? 8 4)
:padding-bottom (if (or small-screen? :padding-bottom (if preview?
(and 12
(> 3 window-scale) (if (or small-screen?
six-reactions?)) (and
(* message-padding-scaling-ratio window-scale) (> 3 window-scale)
4) six-reactions?))
(* message-padding-scaling-ratio window-scale)
4))
:opacity (if (and outgoing (= outgoing-status :sending)) :opacity (if (and outgoing (= outgoing-status :sending))
0.5 0.5
1)}) 1)})

View File

@ -196,7 +196,8 @@
:outgoing-status outgoing-status :outgoing-status outgoing-status
:small-screen? rn/small-screen? :small-screen? rn/small-screen?
:window-scale window-scale :window-scale window-scale
:six-reactions? six-reactions?}) :six-reactions? six-reactions?
:preview? preview?})
:on-press (fn [] :on-press (fn []
(if (and platform/ios? keyboard-shown?) (if (and platform/ios? keyboard-shown?)
(do (do
@ -226,6 +227,7 @@
[gesture/scroll-view]) [gesture/scroll-view])
[{:style {:margin-left 8 [{:style {:margin-left 8
:flex 1 :flex 1
:gap 1
:max-height (when-not show-reactions? :max-height (when-not show-reactions?
(* 0.4 height))}} (* 0.4 height))}}
[author message-data show-reactions? in-reaction-and-action-menu? show-user-info?] [author message-data show-reactions? in-reaction-and-action-menu? show-user-info?]
@ -264,11 +266,13 @@
[reactions/message-reactions-row (assoc message-data :preview? preview?) [reactions/message-reactions-row (assoc message-data :preview? preview?)
[rn/view {:pointer-events :none} [rn/view {:pointer-events :none}
[user-message-content [user-message-content
{:theme theme {:theme theme
:message-data message-data :message-data message-data
:context context :context context
:keyboard-shown? keyboard-shown? :in-reaction-and-action-menu? true
:show-reactions? false}]]])]])))) :keyboard-shown? keyboard-shown?
:preview? true
:show-reactions? true}]]])]]))))
(defn on-long-press (defn on-long-press
[{:keys [deleted? deleted-for-me?] :as message-data} context keyboard-shown?] [{:keys [deleted? deleted-for-me?] :as message-data} context keyboard-shown?]