From 0e9847f2c3930365f8be29d03f4fa132514733f3 Mon Sep 17 00:00:00 2001 From: Mohsen Date: Fri, 1 Mar 2024 16:14:05 +0300 Subject: [PATCH] [#18963] feat: actions UI for stranger contact profile (#19028) --- .../profile/contact/actions/view.cljs | 31 +++++++++++++++++++ .../contexts/profile/contact/view.cljs | 11 +++++-- translations/en.json | 2 +- 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 src/status_im/contexts/profile/contact/actions/view.cljs diff --git a/src/status_im/contexts/profile/contact/actions/view.cljs b/src/status_im/contexts/profile/contact/actions/view.cljs new file mode 100644 index 0000000000..83fa22292f --- /dev/null +++ b/src/status_im/contexts/profile/contact/actions/view.cljs @@ -0,0 +1,31 @@ +(ns status-im.contexts.profile.contact.actions.view + (:require [quo.core :as quo] + [status-im.common.not-implemented :as not-implemented] + [utils.i18n :as i18n])) + +(defn view + [] + [quo/action-drawer + [[{:icon :i/edit + :label (i18n/label :t/add-nickname-title) + :on-press not-implemented/alert + :accessibility-label :add-nickname} + {:icon :i/qr-code + :label (i18n/label :t/show-qr) + :on-press not-implemented/alert + :accessibility-label :show-qr-code} + {:icon :i/share + :label (i18n/label :t/share-profile) + :on-press not-implemented/alert + :accessibility-label :share-profile} + {:icon :i/untrustworthy + :label (i18n/label :t/mark-untrustworthy) + :on-press not-implemented/alert + :accessibility-label :mark-untrustworthy + :add-divider? true + :danger? true} + {:icon :i/block + :label (i18n/label :t/block-user) + :on-press not-implemented/alert + :accessibility-label :block-user + :danger? true}]]]) diff --git a/src/status_im/contexts/profile/contact/view.cljs b/src/status_im/contexts/profile/contact/view.cljs index cb225afedd..ec6b857c4d 100644 --- a/src/status_im/contexts/profile/contact/view.cljs +++ b/src/status_im/contexts/profile/contact/view.cljs @@ -1,9 +1,10 @@ (ns status-im.contexts.profile.contact.view (:require [quo.foundations.colors :as colors] [quo.theme] + [react-native.core :as rn] [react-native.reanimated :as reanimated] - [status-im.common.not-implemented :as not-implemented] [status-im.common.scroll-page.view :as scroll-page] + [status-im.contexts.profile.contact.actions.view :as actions] [status-im.contexts.profile.contact.header.view :as contact-header] [utils.re-frame :as rf])) @@ -11,7 +12,11 @@ [] (let [{:keys [customization-color]} (rf/sub [:contacts/current-contact]) scroll-y (reanimated/use-shared-value 0) - theme (quo.theme/use-theme-value)] + theme (quo.theme/use-theme-value) + on-action-press (rn/use-callback (fn [] + (rf/dispatch [:show-bottom-sheet + {:content (fn [] + [actions/view])}])))] [scroll-page/scroll-page {:navigate-back? true :height 148 @@ -20,5 +25,5 @@ :cover-color (or customization-color colors/primary-50) :background-color (colors/theme-colors colors/white colors/neutral-95 theme) :page-nav-props {:right-side [{:icon-name :i/options - :on-press not-implemented/alert}]}} + :on-press on-action-press}]}} [contact-header/view {:scroll-y scroll-y}]])) diff --git a/translations/en.json b/translations/en.json index 9f1e6d0a22..25a20fcedf 100644 --- a/translations/en.json +++ b/translations/en.json @@ -2063,7 +2063,7 @@ "and": "and", "rename": "Rename", "mark-untrustworthy": "Mark as Untrustworthy", - "block-user": "Block User", + "block-user": "Block user", "group-details": "Group details", "edit-name-and-image": "Edit name and image", "change-group-privacy": "Change group privacy",