diff --git a/native/chat/relationship-prompt.react.js b/native/chat/relationship-prompt.react.js
--- a/native/chat/relationship-prompt.react.js
+++ b/native/chat/relationship-prompt.react.js
@@ -9,7 +9,7 @@
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
import type { UserInfo } from 'lib/types/user-types.js';
-import Button from '../components/button.react.js';
+import LoadableButton from '../components/loadable-button.react.js';
import { useStyles } from '../themes/colors.js';
import { unknownErrorAlertDetails } from '../utils/alert-messages.js';
import Alert from '../utils/alert.js';
@@ -34,6 +34,12 @@
const {
otherUserInfo,
callbacks: { blockUser, unblockUser, friendUser, unfriendUser },
+ loadingState: {
+ isLoadingBlockUser,
+ isLoadingUnblockUser,
+ isLoadingFriendUser,
+ isLoadingUnfriendUser,
+ },
} = useRelationshipPrompt(
threadInfo,
onErrorCallback,
@@ -41,6 +47,16 @@
);
const styles = useStyles(unboundStyles);
+ const greenButtonStyles = React.useMemo(
+ () => [styles.button, styles.greenButton],
+ [styles.button, styles.greenButton],
+ );
+
+ const redButtonStyles = React.useMemo(
+ () => [styles.button, styles.redButton],
+ [styles.button, styles.redButton],
+ );
+
if (
!otherUserInfo ||
!otherUserInfo.username ||
@@ -54,10 +70,14 @@
) {
return (
-
+ Block user
+
);
}
@@ -70,13 +90,14 @@
) {
return (
-
+ Unblock user
+
);
}
@@ -87,20 +108,22 @@
) {
return (
-
-
+ Reject friend request
+
);
}
@@ -110,30 +133,36 @@
) {
return (
-
+ Withdraw friend request
+
);
}
return (
-
-
+ Block user
+
);
},
@@ -152,6 +181,7 @@
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
+ alignItems: 'center',
marginHorizontal: 5,
},
greenButton: {