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
[user-id]
(let [profile (rf/sub [:contacts/contact-by-identity user-id])]
[quo/context-tag
{:blur? true
:size 24
:full-name (profile.utils/displayed-name profile)
:profile-picture (profile.utils/photo profile)}]))
[rn/view
{:on-start-should-set-responder
(fn [_event]
(rf/dispatch [:navigate-back])
(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
[{:keys [active-swipeable

View File

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