From 0efdea6962e354e05834f39665f699803ffae99f Mon Sep 17 00:00:00 2001 From: Sean Hagstrom Date: Tue, 12 Mar 2024 13:48:21 +0000 Subject: [PATCH] Feature: Ignore / Dismiss contact requests from contact profile (#19166) * chore: add english translation for "contact request ignored" * feature: integrate action to ignore contact request and display toast * wip: default to showing "send contact request" after ignoring contact request --- .../profile/contact/contact_review/view.cljs | 13 +++++++++++-- .../contexts/profile/contact/header/view.cljs | 3 ++- translations/en.json | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/status_im/contexts/profile/contact/contact_review/view.cljs b/src/status_im/contexts/profile/contact/contact_review/view.cljs index 4a26fad104..ab00ce4545 100644 --- a/src/status_im/contexts/profile/contact/contact_review/view.cljs +++ b/src/status_im/contexts/profile/contact/contact_review/view.cljs @@ -28,8 +28,17 @@ :text (i18n/label :t/contact-request-was-accepted)}])) [contact-request-id]) - on-contact-ignore (rn/use-callback (fn [] - (rf/dispatch [:hide-bottom-sheet])))] + on-contact-ignore (rn/use-callback + (fn [] + (rf/dispatch [:hide-bottom-sheet]) + (rf/dispatch [:activity-center.contact-requests/decline + contact-request-id]) + (rf/dispatch [:toasts/upsert + {:id :ignore-contact-request + :type :positive + :text (i18n/label + :t/contact-request-was-ignored)}])) + [contact-request-id])] [:<> [quo/drawer-top {:type :context-tag diff --git a/src/status_im/contexts/profile/contact/header/view.cljs b/src/status_im/contexts/profile/contact/header/view.cljs index a165fb8adb..70021c0df3 100644 --- a/src/status_im/contexts/profile/contact/header/view.cljs +++ b/src/status_im/contexts/profile/contact/header/view.cljs @@ -55,7 +55,8 @@ (cond (or (not contact-request-state) - (= contact-request-state constants/contact-request-state-none)) + (= contact-request-state constants/contact-request-state-none) + (= contact-request-state constants/contact-request-state-dismissed)) [quo/button {:container-style style/button-wrapper :on-press on-contact-request diff --git a/translations/en.json b/translations/en.json index ca696d24f2..b46893bcf9 100644 --- a/translations/en.json +++ b/translations/en.json @@ -1979,6 +1979,7 @@ "contact-request-was-sent": "Contact request sent", "contact-request-sent-to": "Contact request sent to", "contact-request-was-accepted": "Contact request accepted", + "contact-request-was-ignored": "Contact request ignored", "contact-request-is-now-a-contact": "is now a contact", "contact-request-removed-you-as-contact": "removed you as a contact", "contact-request-removed-as-contact": "removed as a contact",