From 0b853ce4a91accb488d5c1ee03120699b69c6091 Mon Sep 17 00:00:00 2001
From: duogenesis <136373989+duogenesis@users.noreply.github.com>
Date: Sun, 29 Oct 2023 15:27:53 +1100
Subject: [PATCH] Change behavior of block button on profile
---
components/prospect-profile-screen.tsx | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/components/prospect-profile-screen.tsx b/components/prospect-profile-screen.tsx
index 1c8cad88..a8cfb91a 100644
--- a/components/prospect-profile-screen.tsx
+++ b/components/prospect-profile-screen.tsx
@@ -281,7 +281,7 @@ const SeeQAndAButton = ({navigation, personId, name, countAnswers}) => {
);
};
-const BlockButton = ({name, personId, isBlocked}) => {
+const BlockButton = ({navigation, name, personId, isBlocked}) => {
const [isLoading, setIsLoading] = useState(false);
const [isBlockedState, setIsBlockedState] = useState(false);
@@ -300,6 +300,9 @@ const BlockButton = ({name, personId, isBlocked}) => {
if (await setBlocked(personId, nextIsBlockedState)) {
setIsBlockedState(nextIsBlockedState);
setIsLoading(false);
+ if (nextIsBlockedState) {
+ navigation.popToTop();
+ }
}
}, [isLoading, isBlockedState, personId]);
@@ -324,6 +327,7 @@ const BlockButton = ({name, personId, isBlocked}) => {
style={{
color: '#777',
overflow: 'hidden',
+ textAlign: 'center',
}}
>
{name === undefined ? '...' : text}
@@ -751,7 +755,12 @@ const Body = ({
name={data?.name}
countAnswers={data?.count_answers}
/>
-
+
>
);