feat: show pinned messages bottom sheet in channel home (#19105)
This commit is contained in:
parent
e5cee4b640
commit
3b5afb5d60
|
@ -33,7 +33,7 @@
|
|||
:description (i18n/label :t/no-pinned-messages-desc)}]])
|
||||
|
||||
(defn f-pinned-messages
|
||||
[{:keys [theme chat-id]}]
|
||||
[{:keys [theme chat-id disable-message-long-press?]}]
|
||||
(let [pinned (rf/sub [:chats/pinned-sorted-list chat-id])
|
||||
render-data (rf/sub [:chats/current-chat-message-list-view-context :in-pinned-view])
|
||||
current-chat (rf/sub [:chats/chat-by-id chat-id])
|
||||
|
@ -60,7 +60,7 @@
|
|||
(if (pos? (count pinned))
|
||||
[rn/flat-list
|
||||
{:data pinned
|
||||
:render-data render-data
|
||||
: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
|
||||
|
|
|
@ -153,6 +153,7 @@
|
|||
(let [{:keys [content-type quoted-message content
|
||||
outgoing outgoing-status pinned-by
|
||||
message-id chat-id]} message-data
|
||||
{:keys [disable-message-long-press?]} context
|
||||
first-image (first (:album message-data))
|
||||
outgoing-status (if (= content-type
|
||||
constants/content-type-album)
|
||||
|
@ -204,7 +205,8 @@
|
|||
(reset! show-delivery-state? true)
|
||||
(js/setTimeout #(reset! show-delivery-state? false)
|
||||
delivery-state-showing-time-ms))))
|
||||
:on-long-press #(on-long-press message-data context keyboard-shown?)}
|
||||
:on-long-press (when-not disable-message-long-press?
|
||||
#(on-long-press message-data context keyboard-shown?))}
|
||||
[:<>
|
||||
(when pinned-by
|
||||
[pin/pinned-by-view pinned-by])
|
||||
|
|
|
@ -128,4 +128,8 @@
|
|||
(rf/defn show-pins-bottom-sheet
|
||||
{:events [:pin-message/show-pins-bottom-sheet]}
|
||||
[cofx chat-id]
|
||||
(navigation/show-bottom-sheet cofx {:content (fn [] [pinned-messages-menu/view {:chat-id chat-id}])}))
|
||||
(navigation/show-bottom-sheet
|
||||
cofx
|
||||
{:content (fn [] [pinned-messages-menu/view
|
||||
{:chat-id chat-id
|
||||
:disable-message-long-press? (not= :chat (get-in cofx [:db :view-id]))}])}))
|
||||
|
|
|
@ -78,11 +78,13 @@
|
|||
:sub-label (i18n/label :t/only-mentions)})
|
||||
|
||||
(defn- action-pinned-messages
|
||||
[]
|
||||
[chat-id]
|
||||
{:icon :i/pin
|
||||
:right-icon :i/chevron-right
|
||||
:accessibility-label :chat-pinned-messages
|
||||
:on-press not-implemented/alert
|
||||
:on-press (fn []
|
||||
(rf/dispatch [:pin-message/load-pin-messages chat-id])
|
||||
(rf/dispatch [:pin-message/show-pins-bottom-sheet chat-id]))
|
||||
:label (i18n/label :t/pinned-messages)})
|
||||
|
||||
|
||||
|
@ -124,7 +126,7 @@
|
|||
(action-mark-as-read)
|
||||
(action-toggle-muted chat-id muted muted-till chat-type)
|
||||
(action-notification-settings)
|
||||
(action-pinned-messages)
|
||||
(action-pinned-messages chat-id)
|
||||
(action-invite-people)
|
||||
(action-qr-code chat-id)
|
||||
(action-share chat-id)]]]
|
||||
|
|
Loading…
Reference in New Issue