diff --git a/src/status_im2/contexts/share/events.cljs b/src/status_im2/contexts/share/events.cljs index ebd8447a032f..f351bea2c3c5 100644 --- a/src/status_im2/contexts/share/events.cljs +++ b/src/status_im2/contexts/share/events.cljs @@ -1,6 +1,9 @@ (ns status-im2.contexts.share.events (:require [taoensso.timbre :as log] - [utils.re-frame :as rf])) + [utils.re-frame :as rf] + [status-im2.common.toasts.events :as toasts] + [utils.i18n :as i18n] + [quo2.foundations.colors :as colors])) (rf/defn open-profile-share-view {:events [:share/open]} @@ -12,3 +15,11 @@ :blur-view? true :blur-view-props {:blur-amount 20 :blur-type :dark}}]}) + +(rf/defn show-emoji-hash-copied-toast + {:events [:share/show-emoji-hash-copied-toast]} + [cofx] + (toasts/upsert cofx + {:icon :alert + :icon-color colors/danger-50 + :text (i18n/label :t/pin-limit-reached)})) diff --git a/src/status_im2/contexts/share/view.cljs b/src/status_im2/contexts/share/view.cljs index 73f8ba193b35..9a2999e3fd1e 100644 --- a/src/status_im2/contexts/share/view.cljs +++ b/src/status_im2/contexts/share/view.cljs @@ -9,7 +9,9 @@ [taoensso.timbre :as log] [reagent.core :as reagent] [quo2.foundations.colors :as colors] + [status-im2.common.toasts.events :as toasts] ;;TODO(siddarthkay) : move these components over to status-im2 ns first + [status-im.ui.components.list-selection :as list-selection] [status-im.ui.components.qr-code-viewer.views :as qr-code-viewer] [status-im.ui.components.copyable-text :as copyable-text] [react-native.fast-image :as fast-image] @@ -18,6 +20,15 @@ (def ^:const profile-tab-id 0) (def ^:const wallet-tab-id 1) +(rf/defn show-emoji-hash-copied-toast + {:events [:share/show-emoji-hash-copied-toast]} + [cofx] + (toasts/upsert cofx + {:icon :alert + :icon-color colors/danger-50 + :text (i18n/label :t/pin-limit-reached)})) + + (defn header [] [rn/view @@ -89,7 +100,10 @@ :size 32 :accessibility-label :link-to-profile :override-theme :dark - ;;:on-press ;;;; TODO(siddarthay) : figure this out and take appropriate action + :on-press (fn [] + (js/setTimeout + #(list-selection/open-share {:message profile-qr-url}) + 250)) } :i/share]]]] @@ -111,6 +125,7 @@ :accessibility-label :link-to-profile :override-theme :dark :style {:margin-right 12} + :on-press #(rf/dispatch [:share/show-emoji-hash-copied-toast]) } :i/copy]]