Add re-send popup to desktop

This commit is contained in:
Andrea Maria Piana 2018-12-11 15:06:58 +01:00
parent 82f9b58b97
commit 090b4a1282
No known key found for this signature in database
GPG Key ID: AA6CCA6DE0E06424
4 changed files with 20 additions and 8 deletions

View File

@ -207,6 +207,7 @@
(fx/defn handle-connection-status-change
[{:keys [db] :as cofx} is-connected?]
(println "ChANGED" is-connected?)
(fx/merge cofx
{:db (assoc db :network-status (if is-connected? :online :offline))}
(mailserver/network-connection-status-changed is-connected?)))

View File

@ -26,3 +26,8 @@
chat-id])}]
(remove nil?)))
(defn get-message-menu-items [chat-id message-id]
[{:text (i18n/label :t/resend-message)
:on-select #(re-frame/dispatch [:chat.ui/resend-message chat-id message-id])}
{:text (i18n/label :t/delete-message)
:on-select #(re-frame/dispatch [:chat.ui/delete-message chat-id message-id])}])

View File

@ -9,6 +9,7 @@
[status-im.chat.commands.receiving :as commands-receiving]
[status-im.ui.screens.chat.styles.message.message :as style]
[status-im.ui.screens.chat.photos :as photos]
[status-im.ui.components.popup-menu.views :as desktop.pop-up]
[status-im.constants :as constants]
[status-im.ui.screens.chat.utils :as chat.utils]
[status-im.utils.identicon :as identicon]
@ -180,24 +181,29 @@
[react/activity-indicator {:animating true}]])
(defn message-not-sent-text [chat-id message-id]
[react/touchable-highlight {:on-press (fn [] (if platform/ios?
[react/touchable-highlight {:on-press (fn [] (cond
platform/ios?
(action-sheet/show {:title (i18n/label :message-not-sent)
:options [{:label (i18n/label :resend-message)
:action #(re-frame/dispatch [:chat.ui/resend-message chat-id message-id])}
{:label (i18n/label :delete-message)
:destructive? true
:action #(re-frame/dispatch [:chat.ui/delete-message chat-id message-id])}]})
platform/desktop?
(desktop.pop-up/show-desktop-menu
(desktop.pop-up/get-message-menu-items chat-id message-id))
:else
(re-frame/dispatch
[:chat.ui/show-message-options {:chat-id chat-id
:message-id message-id}])))}
[react/view style/not-sent-view
[react/text {:style style/not-sent-text}
(i18n/message-status-label (if platform/desktop?
:not-sent-without-tap
:not-sent))]
(when-not platform/desktop?
[react/view style/not-sent-icon
[vector-icons/icon :icons/warning {:color colors/red}]])]])
:not-sent-click
:not-sent-tap))]
[react/view style/not-sent-icon
[vector-icons/icon :icons/warning {:color colors/red}]]]])
(defview command-status [{{:keys [network]} :params}]
(letsubs [current-network [:network-name]]

View File

@ -252,8 +252,8 @@
"start-chat": "Start chat",
"wallet-onboarding-title": "Simple and secure cryptocurrency wallet",
"logout": "Log out",
"status-not-sent": "Not confirmed. Tap for options",
"status-not-sent-without-tap": "Not confirmed",
"status-not-sent-tap": "Not confirmed. Tap for options",
"status-not-sent-click": "Not confirmed. Click for options",
"edit-network-config": "Edit network config",
"clear-history-confirmation": "Clear history?",
"connect": "Connect",