Skip to content

Commit

Permalink
Merge pull request #200 from cuappdev/main-copy
Browse files Browse the repository at this point in the history
Merge External Profiles to Release
  • Loading branch information
rs929 authored May 25, 2024
2 parents b4718f0 + 96ebf25 commit 6f98bc2
Show file tree
Hide file tree
Showing 13 changed files with 1,201 additions and 341 deletions.
13 changes: 7 additions & 6 deletions components/DetailPullup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export function DetailPullUpHeader({
isSaved,
save,
unsave,
displayExternalProfile,
}) {
return (
<View style={[styles.container_header, styles.roundCorner]}>
Expand All @@ -42,13 +43,13 @@ export function DetailPullUpHeader({
<Text style={styles.title}>{item.title}</Text>
<Text style={styles.price}>{"$" + item.price}</Text>
</View>
<View style={styles.paddedRow}>
<FastImage
source={{ uri: sellerProfile }}
style={styles.profileImage}
/>
<TouchableOpacity
onPress={displayExternalProfile}
style={styles.paddedRow}
>
<Image source={{ uri: sellerProfile }} style={styles.profileImage} />
<Text style={styles.profile}>{sellerName}</Text>
</View>
</TouchableOpacity>
</View>
);
}
Expand Down
8 changes: 4 additions & 4 deletions ios/Resell.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
2C0F40B12C00485B00AEFE36 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2C0F40B02C00485B00AEFE36 /* GoogleService-Info.plist */; };
2EE509EA2BD1C5B9005B77C7 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 2EE509E92BD1C5B9005B77C7 /* PrivacyInfo.xcprivacy */; };
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; };
4A1323AFC4AE46A1976ADCC9 /* noop-file.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A41C7A5C5854BC4BAC31533 /* noop-file.swift */; };
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; };
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
D2AF6D5ABF5185ECF8FDCB8C /* Pods_Resell.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 47E67E65AD48A1038D43F9B8 /* Pods_Resell.framework */; };
E9B8CB89F9D0437B900215B2 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 553DCD166C1A436292258F8A /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -26,9 +26,9 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = Resell/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Resell/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Resell/main.m; sourceTree = "<group>"; };
2C0F40B02C00485B00AEFE36 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../config/GoogleService-Info.plist"; sourceTree = "<group>"; };
2EE509E92BD1C5B9005B77C7 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
47E67E65AD48A1038D43F9B8 /* Pods_Resell.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Resell.framework; sourceTree = BUILT_PRODUCTS_DIR; };
553DCD166C1A436292258F8A /* GoogleService-Info.plist */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Resell/GoogleService-Info.plist"; sourceTree = "<group>"; };
5A41C7A5C5854BC4BAC31533 /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "Resell/noop-file.swift"; sourceTree = "<group>"; };
6C2E3173556A471DD304B334 /* Pods-Resell.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Resell.debug.xcconfig"; path = "Target Support Files/Pods-Resell/Pods-Resell.debug.xcconfig"; sourceTree = "<group>"; };
7A4D352CD337FB3A3BF06240 /* Pods-Resell.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Resell.release.xcconfig"; path = "Target Support Files/Pods-Resell/Pods-Resell.release.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -60,7 +60,7 @@
13B07FB61A68108700A75B9A /* Info.plist */,
13B07FB71A68108700A75B9A /* main.m */,
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
553DCD166C1A436292258F8A /* GoogleService-Info.plist */,
2C0F40B02C00485B00AEFE36 /* GoogleService-Info.plist */,
5A41C7A5C5854BC4BAC31533 /* noop-file.swift */,
2EE509E92BD1C5B9005B77C7 /* PrivacyInfo.xcprivacy */,
);
Expand Down Expand Up @@ -207,7 +207,7 @@
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */,
2EE509EA2BD1C5B9005B77C7 /* PrivacyInfo.xcprivacy in Resources */,
E9B8CB89F9D0437B900215B2 /* GoogleService-Info.plist in Resources */,
2C0F40B12C00485B00AEFE36 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
22 changes: 21 additions & 1 deletion navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ import ReportPostConfirmScreen from "../screens/ReportPostConfirmScreen";
import ReportPostDetailsScreen from "../screens/ReportPostDetailsScreen";
import ReportPostScreen from "../screens/ReportPostScreen";
import RequestMatches from "../screens/RequestMatches";
import ExternalProfileScreen from "../screens/ExternalProfileScreen";
import ProfileSearchScreen from "../screens/ProfileSearchScreen";

export default function Navigation({
colorScheme,
Expand All @@ -83,7 +85,7 @@ export default function Navigation({
return (
<NavigationContainer
linking={LinkingConfiguration}
// theme={colorScheme === "dark" ? DarkTheme : DefaultTheme}
// theme={colorScheme === "dark" ? DarkTheme : DefaultTheme}
>
<RootNavigator onboard={onboard} />
</NavigationContainer>
Expand Down Expand Up @@ -287,6 +289,24 @@ function RootNavigator({ onboard }) {
headerTransparent: true,
}}
/>
<Stack.Screen
name="ExternalProfile"
component={ExternalProfileScreen}
options={{
headerShown: false,
headerTitle: "",
headerTransparent: true,
}}
/>
<Stack.Screen
name="SearchProfile"
component={ProfileSearchScreen}
options={{
headerShown: false,
headerTitle: "",
headerTransparent: true,
}}
/>
<Stack.Screen
name="ReportPost"
component={ReportPostScreen}
Expand Down
2 changes: 2 additions & 0 deletions navigation/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export type RootStackParamList = {
ReportPostDetails: undefined;
ReportPostConfirm: undefined;
ChatWindow: undefined;
ExternalProfile: undefined;
SearchProfile: undefined;
};
export type HomeStackParamList = {
Home: { showPanel: boolean };
Expand Down
29 changes: 22 additions & 7 deletions screens/BlockedUsersScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,30 @@ export default function BlockedUsersScreen({ navigation }) {
}
}, [userId]);

const displayExternalProfile = (user) => {
navigation.navigate("ExternalProfile", {
sellerName: "HELLO",
sellerId: user.id,
sellerUsername: user.username,
isBlocked: true
});
}

const renderItem = ({ item }) => (
<View style={styles.cell}>
<View style={styles.userContainer}>
<FastImage
style={styles.profileImage}
source={{ uri: item.photoUrl }}
/>
<Text style={styles.userName}>{item.username}</Text>
</View>
<TouchableOpacity
onPress={() => displayExternalProfile(item)}
>
<View style={styles.userContainer}>

<FastImage
style={styles.profileImage}
source={{ uri: item.photoUrl }}
/>
<Text style={styles.userName}>{item.username}</Text>

</View>
</TouchableOpacity>
<TouchableOpacity
onPress={() => {
setSelectedUser(item);
Expand Down
9 changes: 4 additions & 5 deletions screens/ChatScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function ChatScreen({ navigation }) {
} else {
makeToast({ message: "Error blocking user", type: "ERROR" });
}
} catch (e: unknown) {}
} catch (e: unknown) { }
};

const getPurchase = (): Unsubscribe => {
Expand Down Expand Up @@ -241,7 +241,7 @@ export default function ChatScreen({ navigation }) {
style={[
styles.image,
(isPurchase && purchaseUnread != 0) ||
(!isPurchase && offerUnread != 0)
(!isPurchase && offerUnread != 0)
? { marginStart: 24 }
: { marginStart: 12 },
]}
Expand All @@ -261,11 +261,10 @@ export default function ChatScreen({ navigation }) {
<Text
numberOfLines={1}
style={[fonts.Title4, { color: Colors.secondaryGray }]}
>{`${
chatPreview.items.length > 0
>{`${chatPreview.items.length > 0
? chatPreview.items[0].title
: "loading..."
}`}</Text>
}`}</Text>
</View>
{chatPreview.items.length > 1 && (
<>
Expand Down
44 changes: 30 additions & 14 deletions screens/ChatWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ export default function ChatWindow({ navigation, route }) {
sellerId: post.user.id,
postId: post.id,
userId: "userId",
type: "User"
});
};

Expand All @@ -521,7 +522,7 @@ export default function ChatWindow({ navigation, route }) {
} else {
makeToast({ message: "Error blocking user", type: "ERROR" });
}
} catch (e: unknown) {}
} catch (e: unknown) { }
};

const menuItems = [
Expand Down Expand Up @@ -687,6 +688,7 @@ export default function ChatWindow({ navigation, route }) {
sellerId: "sellerId", // TODO: Add when Implementing Reporting Backend
postId: post.id,
userId: auth.currentUser.uid,
type: "Message"
});
break;
}
Expand Down Expand Up @@ -899,7 +901,7 @@ export default function ChatWindow({ navigation, route }) {
setProposer(meetingInfo.proposer);
setMeetingDetailText(
(meetingInfo.proposer === auth.currentUser.email ? "You" : name) +
" confirmed the following meeting:"
" confirmed the following meeting:"
);
}
if (
Expand All @@ -918,9 +920,9 @@ export default function ChatWindow({ navigation, route }) {
setActionButtons((buttons) =>
buttons.filter((b) => b.title.includes("View")).length === 0
? [
...buttons,
{ title: `View ${name.split(" ")[0]}'s availability`, id: 3 },
]
...buttons,
{ title: `View ${name.split(" ")[0]}'s availability`, id: 3 },
]
: buttons
);
}
Expand Down Expand Up @@ -1102,6 +1104,15 @@ export default function ChatWindow({ navigation, route }) {
return <BottomSheetBackdrop {...props} appearsOnIndex={1} />;
}

const displayExternalProfile = () => {
navigation.navigate("ExternalProfile", {
sellerName: name,
sellerId: post.user.id,
sellerUsername: post.user.username,
isBlocked: false
});
}

const ref = useRef<any>();
return (
<BottomSheetModalProvider>
Expand Down Expand Up @@ -1139,16 +1150,21 @@ export default function ChatWindow({ navigation, route }) {
justifyContent: "center",
}}
>
<Text
style={[fonts.Title1, { marginBottom: 4, textAlign: "center" }]}
>
{name}
</Text>
<Text
style={[fonts.Title3, { color: "#787878", textAlign: "center" }]}
<TouchableOpacity
onPress={displayExternalProfile}
>
{items.length > 0 ? itemsAsString(items) : post.title}
</Text>
<Text
style={[fonts.Title1, { marginBottom: 4, textAlign: "center" }]}
>
{name}
</Text>
<Text
style={[fonts.Title3, { color: "#787878", textAlign: "center" }]}
>
{items.length > 0 ? itemsAsString(items) : post.title}
</Text>

</TouchableOpacity>
</View>
<View>
<TouchableOpacity
Expand Down
60 changes: 60 additions & 0 deletions screens/ExternalPostRoute.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React from "react";
import { View, Text, Platform, StyleSheet } from "react-native";
import { ProductList } from "../components/ProductList";
import { fonts } from "../globalStyle/globalFont";
import LoadingScreen from "./LoadingScreen";

export const ExternalPostRoute = ({
navigation,
isLoading,
fetchFailed,
posts,
onRefresh,
}) => (
<View
style={{
height: "100%",
flex: 1,
}}
>
{isLoading ? (
<LoadingScreen screen={"Profile"} />
) : fetchFailed ? (
<LoadingScreen screen={"Profile"} />
) : posts.length > 0 ? (
<ProductList
data={posts}
screen={"Profile"}
navigation={navigation}
onRefresh={onRefresh}
/>
) : (
<View
style={[
styles.noResultView,
Platform.OS === "ios" ? { marginBottom: 60 } : { marginBottom: 90 },
]}
>
<Text style={[fonts.pageHeading2, { marginBottom: 8 }]}>
No listings posted
</Text>
<Text style={[fonts.body1, styles.bodyText]}>
When you post a listing, it will be displayed here
</Text>
</View>
)}
</View>
);

const styles = StyleSheet.create({
noResultView: {
flex: 1,
justifyContent: "center",
alignItems: "center",
},
bodyText: {
color: "#707070",
marginHorizontal: 48,
textAlign: "center",
}
});
Loading

0 comments on commit 6f98bc2

Please sign in to comment.