Skip to content

Commit 0a3fbf2

Browse files
committed
add view profile on long message press
1 parent 4c89b84 commit 0a3fbf2

File tree

3 files changed

+56
-55
lines changed

3 files changed

+56
-55
lines changed

src/status_im/ui/screens/chat/message/message.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[status-im.ui.components.react :as react]
1515
[status-im.utils.money :as money]
1616
[status-im.ethereum.transactions.core :as transactions]
17-
[status-im.ui.screens.chat.message.sheets :as sheets]
17+
[status-im.ui.screens.chat.sheets :as sheets]
1818
[status-im.ui.screens.chat.photos :as photos]
1919
[status-im.ui.screens.chat.styles.message.message :as style]
2020
[status-im.ui.screens.chat.utils :as chat.utils]

src/status_im/ui/screens/chat/message/sheets.cljs

-53
This file was deleted.

src/status_im/ui/screens/chat/sheets.cljs

+55-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
[status-im.ui.components.colors :as colors]
1010
[status-im.utils.platform :as platform]
1111
[status-im.ui.components.chat-icon.screen :as chat-icon.screen]
12+
[status-im.ui.screens.chat.styles.message.sheets :as sheets.styles]
1213
[status-im.ui.components.list-item.views :as list-item])
1314
(:require-macros [status-im.utils.views :refer [defview letsubs]]))
1415

@@ -89,7 +90,8 @@
8990
:icon :main-icons/delete
9091
:on-press #(hide-sheet-and-dispatch [:chat.ui/remove-chat-pressed chat-id])}]]))
9192

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]}]
9395
[react/view
9496
[list-item/list-item
9597
{:theme :action
@@ -124,3 +126,55 @@
124126
public? [public-chat-actions current-chat]
125127
group-chat [group-chat-actions current-chat]
126128
: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

Comments
 (0)