I got pfps working basicallly
This commit is contained in:
@ -2,8 +2,10 @@ import React, { useState, useEffect } from 'react';
|
||||
import { StyleSheet, TouchableOpacity, Image, Alert, ActivityIndicator } from 'react-native';
|
||||
import * as ImagePicker from 'expo-image-picker';
|
||||
import { supabase } from '@/lib/supabase';
|
||||
import { ThemedView, ThemedText, ThemedTextInput } from '@/components/theme';
|
||||
import { ThemedView, ThemedText, ThemedTextButton, ThemedTextInput } from '@/components/theme';
|
||||
import { IconSymbol } from '@/components/ui/IconSymbol';
|
||||
import Avatar from '@/components/auth/Profile_Avatar';
|
||||
import { Session } from '@supabase/supabase-js'
|
||||
|
||||
export default function ProfileScreen() {
|
||||
const [loading, setLoading] = useState(false);
|
||||
@ -72,16 +74,12 @@ export default function ProfileScreen() {
|
||||
|
||||
return (
|
||||
<ThemedView style={styles.container}>
|
||||
<TouchableOpacity style={styles.avatarContainer}>
|
||||
{avatar ? (
|
||||
<Image source={{ uri: avatar }} style={styles.avatar} />
|
||||
) : (
|
||||
<ThemedView style={styles.avatarPlaceholder}>
|
||||
<IconSymbol name="person.fill" size={50} color="#999" />
|
||||
</ThemedView>
|
||||
)}
|
||||
<ThemedText style={styles.changePhotoText}>Change Photo</ThemedText>
|
||||
</TouchableOpacity>
|
||||
|
||||
<Avatar
|
||||
size={50}
|
||||
url={avatar}
|
||||
onUpload={updateProfile}
|
||||
/>
|
||||
|
||||
<ThemedView style={styles.formSection}>
|
||||
<ThemedText style={styles.label}>Full Name</ThemedText>
|
||||
@ -92,28 +90,18 @@ export default function ProfileScreen() {
|
||||
style={styles.input}
|
||||
/>
|
||||
|
||||
<ThemedText style={styles.label}>Email</ThemedText>
|
||||
<ThemedTextInput
|
||||
value={email}
|
||||
onChangeText={setEmail}
|
||||
placeholder="Enter your email"
|
||||
keyboardType="email-address"
|
||||
autoCapitalize="none"
|
||||
style={styles.input}
|
||||
/>
|
||||
</ThemedView>
|
||||
|
||||
<TouchableOpacity
|
||||
style={styles.saveButton}
|
||||
<ThemedTextButton
|
||||
text='Save Changes'
|
||||
onPress={updateProfile}
|
||||
disabled={loading}
|
||||
>
|
||||
{loading ? (
|
||||
<ActivityIndicator color="#fff" />
|
||||
) : (
|
||||
<ThemedText style={styles.saveButtonText}>Save Changes</ThemedText>
|
||||
)}
|
||||
</TouchableOpacity>
|
||||
fontSize={18}
|
||||
fontWeight='semibold'
|
||||
width='90%'
|
||||
style={styles.saveButton}
|
||||
/>
|
||||
|
||||
</ThemedView>
|
||||
);
|
||||
}
|
||||
@ -122,6 +110,7 @@ const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
padding: 16,
|
||||
alignItems: 'center',
|
||||
},
|
||||
avatarContainer: {
|
||||
alignItems: 'center',
|
||||
@ -161,13 +150,8 @@ const styles = StyleSheet.create({
|
||||
marginBottom: 20,
|
||||
},
|
||||
saveButton: {
|
||||
backgroundColor: '#007AFF',
|
||||
paddingVertical: 14,
|
||||
borderRadius: 8,
|
||||
alignItems: 'center',
|
||||
},
|
||||
saveButtonText: {
|
||||
color: '#fff',
|
||||
fontSize: 16,
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user