Fixed image not displaying. I think we may have most of the homepage working now!

This commit is contained in:
Gabriel Brown 2024-10-18 14:27:27 -05:00
parent 7fbaad97a1
commit c0c6ad5af4
2 changed files with 6 additions and 7 deletions

View File

@ -150,7 +150,7 @@ const RelationshipView: React.FC<RelationshipProps> = ({ pfpUrl }) => {
<ThemedView style={styles.profileWrapper}> <ThemedView style={styles.profileWrapper}>
<Image <Image
source={{ source={{
uri: `${process.env.EXPO_PUBLIC_URL}` + uri: `${process.env.EXPO_PUBLIC_API_URL}` +
`${status.partner.pfpUrl}` `${status.partner.pfpUrl}`
}} }}
style={styles.profilePicture} style={styles.profilePicture}
@ -185,7 +185,7 @@ const RelationshipView: React.FC<RelationshipProps> = ({ pfpUrl }) => {
<ThemedView style={styles.profileWrapper}> <ThemedView style={styles.profileWrapper}>
<Image <Image
source={{ source={{
uri: `${process.env.EXPO_PUBLIC_URL}` + uri: `${process.env.EXPO_PUBLIC_API_URL}` +
`${status.partner.pfpUrl}` `${status.partner.pfpUrl}`
}} }}
style={styles.profilePicture} style={styles.profilePicture}
@ -221,7 +221,7 @@ const RelationshipView: React.FC<RelationshipProps> = ({ pfpUrl }) => {
{user && ( {user && (
<ThemedView style={styles.profileWrapper}> <ThemedView style={styles.profileWrapper}>
<Image <Image
source={{ uri: `${process.env.EXPO_PUBLIC_URL}${user.pfpUrl}` }} source={{ uri: `${process.env.EXPO_PUBLIC_API_URL}${user.pfpUrl}` }}
style={styles.profilePicture} style={styles.profilePicture}
/> />
<ThemedText style={styles.name}> <ThemedText style={styles.name}>
@ -232,7 +232,7 @@ const RelationshipView: React.FC<RelationshipProps> = ({ pfpUrl }) => {
{status.partner && ( {status.partner && (
<ThemedView style={styles.profileWrapper}> <ThemedView style={styles.profileWrapper}>
<Image <Image
source={{ uri: `${process.env.EXPO_PUBLIC_URL}` + source={{ uri: `${process.env.EXPO_PUBLIC_API_URL}` +
`${status.partner.pfpUrl}` }} `${status.partner.pfpUrl}` }}
style={styles.profilePicture} style={styles.profilePicture}
/> />

View File

@ -19,6 +19,7 @@ const UserInfo: React.FC<UserInfoProps> = ({ onPfpUpdate }) => {
try { try {
const user: User = await getUser() as User; const user: User = await getUser() as User;
setUser(user); setUser(user);
console.log(`${process.env.EXPO_PUBLIC_API_URL}${user.pfpUrl}`);
if (user.pfpUrl) if (user.pfpUrl)
onPfpUpdate(user.pfpUrl); onPfpUpdate(user.pfpUrl);
} catch (error) { } catch (error) {
@ -72,7 +73,7 @@ const UserInfo: React.FC<UserInfoProps> = ({ onPfpUpdate }) => {
<TouchableOpacity onPress={handleUpdateProfilePicture}> <TouchableOpacity onPress={handleUpdateProfilePicture}>
<Image <Image
source={user.pfpUrl ? { source={user.pfpUrl ? {
uri: `${process.env.EXPO_PUBLIC_URL}${user.pfpUrl}`} : uri: `${process.env.EXPO_PUBLIC_API_URL}${user.pfpUrl}`} :
require('@/assets/images/default-profile.png')} require('@/assets/images/default-profile.png')}
style={styles.profilePicture} style={styles.profilePicture}
/> />
@ -114,5 +115,3 @@ const styles = StyleSheet.create({
marginBottom: 20, marginBottom: 20,
}, },
}); });