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, @@ -54,10 +60,14 @@ ) { return ( - + Block user + ); } @@ -70,13 +80,14 @@ ) { return ( - + Unblock user + ); } @@ -87,20 +98,22 @@ ) { return ( - - + Reject friend request + ); } @@ -110,30 +123,36 @@ ) { return ( - + Withdraw friend request + ); } return ( - - + Block user + ); }, @@ -152,6 +171,7 @@ flex: 1, flexDirection: 'row', justifyContent: 'center', + alignItems: 'center', marginHorizontal: 5, }, greenButton: { @@ -160,6 +180,13 @@ redButton: { backgroundColor: 'vibrantRedButton', }, + buttonContentContainer: { + flexDirection: 'row', + alignItems: 'center', + }, + buttonLoading: { + opacity: 0, + }, buttonText: { fontSize: 11, color: 'white', @@ -167,6 +194,9 @@ textAlign: 'center', marginLeft: 5, }, + loadingSpinner: { + position: 'absolute', + }, }; export default RelationshipPrompt;