Skip to content

Commit 7065f4a

Browse files
[#19101] feat: share contact profile (#19154)
1 parent e283a72 commit 7065f4a

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

src/react_native/core.cljs

+4
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,7 @@
224224
(defn open-url [link] (.openURL ^js linking link))
225225

226226
(def set-status-bar-style react-native/StatusBar.setBarStyle)
227+
228+
(defn sharing
229+
[content]
230+
(.share (.-Share ^js react-native) (clj->js content)))

src/status_im/common/universal_links.cljs

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
:params [public-key]
187187
:on-success (fn [url]
188188
(rf/dispatch [:universal-links/save-profile-url public-key url])
189-
(when (fn? on-success) (on-success)))
189+
(when (fn? on-success) (on-success url)))
190190
:on-error #(log/error "failed to wakuext_shareUserURLWithData"
191191
{:error %
192192
:public-key public-key})}]})))

src/status_im/contexts/profile/contact/actions/view.cljs

+8-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@
2929
:on-success #(rf/dispatch [:open-modal
3030
:share-contact])}]))
3131
[public-key])
32-
has-nickname? (rn/use-memo (fn [] (not (string/blank? nickname))) [nickname])]
32+
has-nickname? (rn/use-memo (fn [] (not (string/blank? nickname))) [nickname])
33+
on-share-profile (rn/use-callback
34+
(fn []
35+
(rf/dispatch [:universal-links/generate-profile-url
36+
{:public-key public-key
37+
:on-success #(rn/sharing {:message %})}]))
38+
[public-key])]
3339
[quo/action-drawer
3440
[[{:icon :i/edit
3541
:label (if has-nickname?
@@ -43,7 +49,7 @@
4349
:accessibility-label :show-qr-code}
4450
{:icon :i/share
4551
:label (i18n/label :t/share-profile)
46-
:on-press not-implemented/alert
52+
:on-press on-share-profile
4753
:accessibility-label :share-profile}
4854
(when has-nickname?
4955
{:icon :i/delete

0 commit comments

Comments
 (0)