|
5 | 5 | [react-native.core :as rn]
|
6 | 6 | [react-native.fast-image :as fast-image]
|
7 | 7 | [react-native.gesture :as gesture]
|
8 |
| - [react-native.safe-area :as safe-area] |
9 | 8 | [status-im2.contexts.chat.menus.pinned-messages.style :as style]
|
10 | 9 | [status-im2.contexts.chat.messages.content.view :as message]
|
11 | 10 | [utils.i18n :as i18n]
|
|
24 | 23 | [message _ _ context]
|
25 | 24 | [message/message message context (atom false)])
|
26 | 25 |
|
| 26 | +(defn empty-pinned-messages-state |
| 27 | + [{:keys [community?]}] |
| 28 | + [rn/view {:style style/no-pinned-messages-container} |
| 29 | + [rn/view {:style style/no-pinned-messages-icon} |
| 30 | + [quo/icon :i/placeholder]] |
| 31 | + [rn/view {:style style/no-pinned-messages-content} |
| 32 | + [quo/text |
| 33 | + {:size :paragraph-1 |
| 34 | + :weight :semi-bold |
| 35 | + :style style/no-pinned-messages-title} |
| 36 | + (i18n/label :t/no-pinned-messages)] |
| 37 | + [quo/text |
| 38 | + {:size :paragraph-2 |
| 39 | + :style style/no-pinned-messages-text} |
| 40 | + (i18n/label |
| 41 | + (if community? |
| 42 | + :t/no-pinned-messages-community-desc |
| 43 | + :t/no-pinned-messages-desc))]]]) |
| 44 | + |
27 | 45 | (defn pinned-messages
|
28 | 46 | [chat-id]
|
29 | 47 | (let [pinned (rf/sub [:chats/pinned-sorted-list chat-id])
|
30 | 48 | render-data (rf/sub [:chats/current-chat-message-list-view-context :in-pinned-view])
|
31 | 49 | current-chat (rf/sub [:chat-by-id chat-id])
|
32 | 50 | {:keys [community-id]} current-chat
|
33 | 51 | community (rf/sub [:communities/community community-id])
|
34 |
| - bottom-inset (safe-area/get-bottom) |
35 | 52 | community-images (rf/sub [:community/images community-id])]
|
36 | 53 | [gesture/scroll-view
|
37 |
| - {:accessibility-label :pinned-messages-menu} |
| 54 | + {:accessibility-label :pinned-messages-menu |
| 55 | + :bounces false} |
38 | 56 | [:<>
|
39 | 57 | [quo/text
|
40 | 58 | {:size :heading-2
|
|
61 | 79 | {:data pinned
|
62 | 80 | :render-data render-data
|
63 | 81 | :render-fn message-render-fn
|
64 |
| - :footer [rn/view {:style (style/list-footer bottom-inset)}] |
| 82 | + :footer [rn/view {:style style/list-footer}] |
65 | 83 | :key-fn list-key-fn
|
66 | 84 | :separator [quo/separator {:style {:margin-vertical 8}}]}]
|
67 |
| - [rn/view {:style (style/no-pinned-messages-container bottom-inset)} |
68 |
| - [rn/view {:style style/no-pinned-messages-icon} |
69 |
| - [quo/icon :i/placeholder]] |
70 |
| - [quo/text |
71 |
| - {:weight :semi-bold |
72 |
| - :style style/no-pinned-messages-text} |
73 |
| - (i18n/label :t/no-pinned-messages)] |
74 |
| - [quo/text {:size :paragraph-2} |
75 |
| - (i18n/label |
76 |
| - (if community |
77 |
| - :t/no-pinned-messages-community-desc |
78 |
| - :t/no-pinned-messages-desc))]])])) |
| 85 | + [empty-pinned-messages-state |
| 86 | + {:community? (boolean community)}])])) |
0 commit comments