Implement navigation to profiles and chats from contact requests inside Activity Center (#19902)

This commit is contained in:
Parvesh Monu 2024-05-08 15:48:50 +05:30 committed by GitHub
parent 07fb3610d1
commit 10f5f9ec7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 10 deletions

View File

@ -12,11 +12,17 @@
(defn user-avatar-tag (defn user-avatar-tag
[user-id] [user-id]
(let [profile (rf/sub [:contacts/contact-by-identity user-id])] (let [profile (rf/sub [:contacts/contact-by-identity user-id])]
[quo/context-tag [rn/view
{:blur? true {:on-start-should-set-responder
:size 24 (fn [_event]
:full-name (profile.utils/displayed-name profile) (rf/dispatch [:navigate-back])
:profile-picture (profile.utils/photo profile)}])) (rf/dispatch [:chat.ui/show-profile user-id])
true)}
[quo/context-tag
{:blur? true
:size 24
:full-name (profile.utils/displayed-name profile)
:profile-picture (profile.utils/photo profile)}]]))
(defn- render-swipe-action (defn- render-swipe-action
[{:keys [active-swipeable [{:keys [active-swipeable

View File

@ -1,7 +1,7 @@
(ns status-im.contexts.shell.activity-center.notification.contact-requests.view (ns status-im.contexts.shell.activity-center.notification.contact-requests.view
(:require (:require
[quo.core :as quo] [quo.core :as quo]
[react-native.gesture :as gesture] [react-native.core :as rn]
[status-im.constants :as constants] [status-im.constants :as constants]
[status-im.contexts.shell.activity-center.notification.common.style :as common-style] [status-im.contexts.shell.activity-center.notification.common.style :as common-style]
[status-im.contexts.shell.activity-center.notification.common.view :as common] [status-im.contexts.shell.activity-center.notification.common.view :as common]
@ -162,10 +162,8 @@
[outgoing-contact-request-view props app-theme] [outgoing-contact-request-view props app-theme]
(= contact-request-state constants/contact-request-message-state-accepted) (= contact-request-state constants/contact-request-message-state-accepted)
[gesture/touchable-without-feedback [rn/pressable
{:on-press (fn [] {:on-press #(rf/dispatch [:chat.ui/start-chat author])}
(rf/dispatch [:hide-popover])
(rf/dispatch [:chat.ui/start-chat author]))}
[incoming-contact-request-view props app-theme]] [incoming-contact-request-view props app-theme]]
:else :else