|
9 | 9 | [status-im.ui.components.colors :as colors]
|
10 | 10 | [status-im.utils.platform :as platform]
|
11 | 11 | [status-im.ui.components.chat-icon.screen :as chat-icon.screen]
|
| 12 | + [status-im.ui.screens.chat.styles.message.sheets :as sheets.styles] |
12 | 13 | [status-im.ui.components.list-item.views :as list-item])
|
13 | 14 | (:require-macros [status-im.utils.views :refer [defview letsubs]]))
|
14 | 15 |
|
|
89 | 90 | :icon :main-icons/delete
|
90 | 91 | :on-press #(hide-sheet-and-dispatch [:chat.ui/remove-chat-pressed chat-id])}]]))
|
91 | 92 |
|
92 |
| -(defn group-chat-actions [{:keys [chat-id contact group-chat chat-name color online]}] |
| 93 | +(defn group-chat-actions |
| 94 | + [{:keys [chat-id contact group-chat chat-name color online]}] |
93 | 95 | [react/view
|
94 | 96 | [list-item/list-item
|
95 | 97 | {:theme :action
|
|
124 | 126 | public? [public-chat-actions current-chat]
|
125 | 127 | group-chat [group-chat-actions current-chat]
|
126 | 128 | :else [chat-actions current-chat]))
|
| 129 | + |
| 130 | + |
| 131 | +(defn options [chat-id message-id] |
| 132 | + (fn [] |
| 133 | + [react/view |
| 134 | + [react/i18n-text {:style sheets.styles/sheet-text :key :message-not-sent}] |
| 135 | + [list-item/list-item |
| 136 | + {:theme :action |
| 137 | + :title :t/resend-message |
| 138 | + :icon :main-icons/refresh |
| 139 | + :accessibility-label :resend-message-button |
| 140 | + :on-press #(hide-sheet-and-dispatch [:chat.ui/resend-message chat-id message-id])}] |
| 141 | + [list-item/list-item |
| 142 | + {:theme :action-destructive |
| 143 | + :title :t/delete-message |
| 144 | + :icon :main-icons/delete |
| 145 | + :accessibility-label :delete-transaction-button |
| 146 | + :on-press #(hide-sheet-and-dispatch [:chat.ui/delete-message chat-id message-id])}]])) |
| 147 | + |
| 148 | +(defn message-long-press [{:keys [message-id content identicon from] :as message}] |
| 149 | + (fn [] |
| 150 | + (let [{:keys [ens-name alias]} @(re-frame/subscribe [:contacts/contact-name-by-identity from])] |
| 151 | + [react/view |
| 152 | + [list-item/list-item |
| 153 | + {:theme :action |
| 154 | + :icon (multiaccounts/displayed-photo {:identicon identicon |
| 155 | + :public-key from}) |
| 156 | + :title [view-profile {:name (or ens-name alias) |
| 157 | + :helper :t/view-profile}] |
| 158 | + :accessibility-label :view-chat-details-button |
| 159 | + :accessories [:chevron] |
| 160 | + :on-press #(hide-sheet-and-dispatch [:chat.ui/show-profile from])}] |
| 161 | + [list-item/list-item |
| 162 | + {:theme :action |
| 163 | + :title :t/message-reply |
| 164 | + :icon :main-icons/reply |
| 165 | + :on-press #(hide-sheet-and-dispatch [:chat.ui/reply-to-message message-id])}] |
| 166 | + [list-item/list-item |
| 167 | + {:theme :action |
| 168 | + :title :t/sharing-copy-to-clipboard |
| 169 | + :icon :main-icons/copy |
| 170 | + :on-press (fn [] |
| 171 | + (re-frame/dispatch [:bottom-sheet/hide-sheet]) |
| 172 | + (react/copy-to-clipboard (:text content)))}] |
| 173 | + (when-not platform/desktop? |
| 174 | + [list-item/list-item |
| 175 | + {:theme :action |
| 176 | + :title :t/sharing-share |
| 177 | + :icon :main-icons/share |
| 178 | + :on-press (fn [] |
| 179 | + (re-frame/dispatch [:bottom-sheet/hide-sheet]) |
| 180 | + (list-selection/open-share {:message (:text content)}))}])]))) |
0 commit comments