I believe most errors are fixed. Rewrite is basically complete
This commit is contained in:
parent
2e36b01266
commit
3f477e8dfb
@ -11,7 +11,6 @@ import {
|
||||
export default class AccessoryBar extends React.Component<any> {
|
||||
render () {
|
||||
const { onSend, isTyping } = this.props;
|
||||
|
||||
return (
|
||||
<ThemedView style={styles.container}>
|
||||
<Button onPress={() => pickImageAsync(onSend)} name='photo' />
|
||||
|
@ -3,12 +3,12 @@ import * as Linking from 'expo-linking';
|
||||
import {
|
||||
Platform,
|
||||
StyleSheet,
|
||||
TouchableOpacity,
|
||||
StyleProp,
|
||||
ViewStyle
|
||||
} from 'react-native';
|
||||
import { ThemedText, ThemedView } from '@/components/theme/Theme';
|
||||
import MapView from 'react-native-maps';
|
||||
import { TouchableOpacity } from 'react-native-gesture-handler';
|
||||
|
||||
type Props = {
|
||||
currentMessage: any;
|
||||
|
@ -132,7 +132,13 @@ const RelationshipView: React.FC<RelationshipProps> = ({ pfpUrl }) => {
|
||||
if (!status || !status.relationship) {
|
||||
// Case 1: Not in a relationship
|
||||
return showRequestRelationship ? (
|
||||
<ThemedView>
|
||||
<RequestRelationship onRequestSent={handleRequestSent} />
|
||||
<TextButton
|
||||
width={220} height={60} text='Stop searching' fontSize={18}
|
||||
onPress={() => setShowRequestRelationship(false)}
|
||||
/>
|
||||
</ThemedView>
|
||||
) : (
|
||||
<TextButton
|
||||
width={220} height={60} text='Request Relationship' fontSize={18}
|
||||
@ -162,13 +168,8 @@ const RelationshipView: React.FC<RelationshipProps> = ({ pfpUrl }) => {
|
||||
</ThemedView>
|
||||
<ThemedView style={styles.buttonContainer}>
|
||||
<TextButton
|
||||
width={100} height={40}
|
||||
text='Accept' fontSize={18}
|
||||
onPress={handleAcceptRequest}
|
||||
/>
|
||||
<TextButton
|
||||
width={100} height={40}
|
||||
text='Reject' fontSize={18}
|
||||
width={150} height={40}
|
||||
text='Cancel Request' fontSize={18}
|
||||
onPress={handleRejectRequest}
|
||||
/>
|
||||
</ThemedView>
|
||||
@ -291,7 +292,6 @@ const styles = StyleSheet.create({
|
||||
marginBottom: 10,
|
||||
},
|
||||
buttonContainer: {
|
||||
flexDirection: 'row',
|
||||
justifyContent: 'space-around',
|
||||
width: '100%',
|
||||
marginTop: 20,
|
||||
|
@ -134,6 +134,10 @@ export const updateRelationshipStatus = async (userId: number, status: 'accepted
|
||||
}),
|
||||
});
|
||||
if (!response.ok) {
|
||||
if (status === 'rejected') {
|
||||
console.log('Relationship deleted.');
|
||||
return null;
|
||||
}
|
||||
throw new Error(
|
||||
`Error updating relationship status: ${response.status} ${response.statusText}`
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user