Skip to content

Commit

Permalink
[#18963] feat: actions UI for stranger contact profile (#19028)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri authored Mar 1, 2024
1 parent 1aef310 commit 0e9847f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
31 changes: 31 additions & 0 deletions src/status_im/contexts/profile/contact/actions/view.cljs
Original file line number Diff line number Diff line change
@@ -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}]]])
11 changes: 8 additions & 3 deletions src/status_im/contexts/profile/contact/view.cljs
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
(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]))

(defn view
[]
(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
Expand All @@ -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}]]))
2 changes: 1 addition & 1 deletion translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0e9847f

Please sign in to comment.