aboutsummaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-10-22 15:34:21 -0700
committerGitHub <noreply@github.com>2020-10-22 18:34:21 -0400
commitd0237cbb61e5c4d77c7b0cefc50891639646ee91 (patch)
tree5b0c1e33c1043887ad45c06a30173dc469d28228 /src/routes
parent5db451725d6165de16ee11cda608a05e96e481f9 (diff)
[TMA 236] Comments PR (#64)
* Added comments count and retrieve comments * Working draft * The one before cleanup * Finally * Added time icon and major refactoring * Small fix for social media taggs * Addressed review comments
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/profile/Profile.tsx26
-rw-r--r--src/routes/profile/ProfileStack.tsx7
2 files changed, 33 insertions, 0 deletions
diff --git a/src/routes/profile/Profile.tsx b/src/routes/profile/Profile.tsx
index 736127bf..8ab8ecde 100644
--- a/src/routes/profile/Profile.tsx
+++ b/src/routes/profile/Profile.tsx
@@ -5,11 +5,25 @@ import {
SocialMediaTaggs,
SearchScreen,
ProfileScreen,
+ MomentCommentsScreen,
} from '../../screens';
import {ProfileStack, ProfileStackParams} from './ProfileStack';
import {RouteProp} from '@react-navigation/native';
import {AvatarTitle} from '../../components';
+/**
+ * What will be the First Screen of the stack depends on value of isProfileView (Search if its true else Profile)
+ * Trying to explain the purpose of each route on the stack (ACTUALLY A STACK)
+ * Profile : To display the logged in user's profile when isProfileView is false, else displays profile of any user the logged in user wants to view.
+ * ProfileView : To display profile of a commenter / any user who has commented on a photo.
+ * When you click on the profile icon after looking at a user's profile, the stack is reset and you come back to the top of the stack (First screen : Profile in this case)
+ * Search : To display the search screen. Search for a user on this screen, click on a result tile and navigate to the same (isProfileView = true).
+ * When you click on the search icon after looking at a user's profile, the stack gets reset and you come back to the top of the stack (First screen : Search in this case)
+ * SocialMediaTaggs : To display user data for any social media account set up by the user.
+ * IndividualMoment : To display individual images uploaded by the user (Navigate to comments from this screen, click on a commenter's profile pic / username, look at a user's profile. Click on the profile icon again to come back to your own profile).
+ * MomentCommentsScreen : Displays comments posted by users on an image uploaded by the user.
+ */
+
type ProfileStackRouteProps = RouteProp<ProfileStackParams, 'Profile'>;
interface ProfileStackProps {
@@ -76,6 +90,18 @@ const Profile: React.FC<ProfileStackProps> = ({route}) => {
options={{headerShown: false}}
initialParams={{isProfileView: isProfileView}}
/>
+ <ProfileStack.Screen
+ name="ProfileView"
+ component={ProfileScreen}
+ options={{headerShown: false}}
+ initialParams={{isProfileView: isProfileView}}
+ />
+ <ProfileStack.Screen
+ name="MomentCommentsScreen"
+ component={MomentCommentsScreen}
+ options={{headerShown: false}}
+ initialParams={{isProfileView: isProfileView}}
+ />
</ProfileStack.Navigator>
);
};
diff --git a/src/routes/profile/ProfileStack.tsx b/src/routes/profile/ProfileStack.tsx
index 1d7b907e..6d875e81 100644
--- a/src/routes/profile/ProfileStack.tsx
+++ b/src/routes/profile/ProfileStack.tsx
@@ -19,6 +19,13 @@ export type ProfileStackParams = {
moment: MomentType;
isProfileView: boolean;
};
+ MomentCommentsScreen: {
+ isProfileView: boolean;
+ moment_id: string;
+ };
+ ProfileView: {
+ isProfileView: boolean;
+ };
};
export const ProfileStack = createStackNavigator<ProfileStackParams>();