[#18963] feat: actions UI for stranger contact profile (#19028)

This commit is contained in:
Mohsen 2024-03-01 16:14:05 +03:00 committed by GitHub
parent 1aef3106bd
commit 0e9847f2c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 40 additions and 4 deletions

View File

@ -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}]]])

View File

@ -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}]]))

View File

@ -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",