diff --git a/src/status_im/android/platform.cljs b/src/status_im/android/platform.cljs index f689de4d2e..3ca9148958 100644 --- a/src/status_im/android/platform.cljs +++ b/src/status_im/android/platform.cljs @@ -167,7 +167,7 @@ (defn show-dialog [{:keys [title options callback]}] (let [dialog (new react-native-dialogs)] (.set dialog (clj->js {:title title - :items options + :items (mapv :text options) :itemsCallback callback})) (.show dialog))) diff --git a/src/status_im/components/context_menu.cljs b/src/status_im/components/context_menu.cljs index 6d59ec78cb..f962548747 100644 --- a/src/status_im/components/context_menu.cljs +++ b/src/status_im/components/context_menu.cljs @@ -27,13 +27,11 @@ (def list-selection-fn (:list-selection-fn platform-specific)) (defn open-ios-menu [options] - (let [cancel-option {:text (label :t/cancel)} - options (conj options cancel-option)] - (list-selection-fn {:options options - :callback (fn [index] - (when (< index (count options)) - (when-let [handler (:value (nth options index))] - (handler))))})) + (list-selection-fn {:options options + :callback (fn [index] + (when (< index (count options)) + (when-let [handler (:value (nth options index))] + (handler))))}) nil) (defn context-menu [trigger options] diff --git a/src/status_im/components/list_selection.cljs b/src/status_im/components/list_selection.cljs index ea9c139cbd..299f4f83a9 100644 --- a/src/status_im/components/list_selection.cljs +++ b/src/status_im/components/list_selection.cljs @@ -17,7 +17,7 @@ (defn share [text dialog-title] (let [list-selection-fn (:list-selection-fn platform-specific)] (list-selection-fn {:title dialog-title - :options [(label :t/sharing-copy-to-clipboard) (label :t/sharing-share)] + :options (share-options text) :callback (fn [index] (case index 0 (copy-to-clipboard text) diff --git a/src/status_im/ios/platform.cljs b/src/status_im/ios/platform.cljs index 493f639580..8f49736a73 100644 --- a/src/status_im/ios/platform.cljs +++ b/src/status_im/ios/platform.cljs @@ -1,5 +1,6 @@ (ns status-im.ios.platform (:require [status-im.components.styles :as styles] + [status-im.i18n :refer [label]] [status-im.utils.utils :as utils])) (def component-styles @@ -194,9 +195,11 @@ (def react-native (js/require "react-native")) (defn action-sheet-options [options] - (let [destructive-opt-index (utils/first-index :destructive? options)] + (let [destructive-opt-index (utils/first-index :destructive? options) + cancel-option {:text (label :t/cancel)} + options (conj options cancel-option)] (clj->js (merge {:options (mapv :text options) - :cancelButtonIndex (count options)} + :cancelButtonIndex (dec (count options))} (when destructive-opt-index {:destructiveButtonIndex destructive-opt-index}))))) (defn show-action-sheet [{:keys [options callback]}]