From 0b338e0c243c63fc836c7a9829ef3787045bc034 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Mon, 10 May 2021 16:28:37 -0400 Subject: added navigation to "Likes" screen --- src/components/comments/CommentTile.tsx | 9 +++- src/components/profile/Friends.tsx | 28 ++++++------ src/routes/main/MainStackNavigator.tsx | 11 ++++- src/routes/main/MainStackScreen.tsx | 8 ++++ src/screens/profile/CommentReactionScreen.tsx | 66 +++++++++++++++++++++++++++ src/screens/profile/FriendsListScreen.tsx | 4 -- src/screens/profile/index.ts | 1 + 7 files changed, 106 insertions(+), 21 deletions(-) create mode 100644 src/screens/profile/CommentReactionScreen.tsx (limited to 'src') diff --git a/src/components/comments/CommentTile.tsx b/src/components/comments/CommentTile.tsx index 8074a015..688a16e6 100644 --- a/src/components/comments/CommentTile.tsx +++ b/src/components/comments/CommentTile.tsx @@ -169,7 +169,14 @@ const CommentTile: React.FC = ({ {' ' + timePosted} - {}}> + { + navigation.navigate('CommentReactionScreen', { + comment: commentObject, + screenType: screenType, + }); + }}> {commentObject.reaction_count} diff --git a/src/components/profile/Friends.tsx b/src/components/profile/Friends.tsx index a7a06567..c9d8e6ae 100644 --- a/src/components/profile/Friends.tsx +++ b/src/components/profile/Friends.tsx @@ -21,9 +21,15 @@ interface FriendsProps { result: Array; screenType: ScreenType; userId: string | undefined; + hideSubheader?: boolean; } -const Friends: React.FC = ({result, screenType, userId}) => { +const Friends: React.FC = ({ + result, + screenType, + userId, + hideSubheader, +}) => { const state: RootState = useStore().getState(); const dispatch = useDispatch(); const {user: loggedInUser = NO_USER} = state.user; @@ -85,14 +91,16 @@ const Friends: React.FC = ({result, screenType, userId}) => { {loggedInUser.userId === userId && usersFromContacts.length !== 0 && ( - Contacts on Tagg + Contacts on Tagg )} - - Friends - + {!hideSubheader && ( + + Friends + + )} = ({route}) => { ...headerBarOptions('black', 'Comments'), }} /> + ; + +interface CommentReactionScreenProps { + route: CommentReactionScreenRouteProps; +} + +const CommentReactionScreen: React.FC = ({ + route, +}) => { + const {comment, screenType} = route.params; + // const [users, setUsers] = useState([]); + const {friends: users} = useSelector((state: RootState) => state.friends); + + useEffect(() => {}, []); + + console.log(screenType); + + return ( + + + + + + + + ); +}; + +const styles = StyleSheet.create({ + background: { + backgroundColor: 'white', + width: SCREEN_WIDTH, + height: SCREEN_HEIGHT, + }, + container: { + marginTop: HeaderHeight, + height: SCREEN_HEIGHT - HeaderHeight, + }, +}); + +export default CommentReactionScreen; diff --git a/src/screens/profile/FriendsListScreen.tsx b/src/screens/profile/FriendsListScreen.tsx index 1d10bc86..73364f3b 100644 --- a/src/screens/profile/FriendsListScreen.tsx +++ b/src/screens/profile/FriendsListScreen.tsx @@ -36,10 +36,6 @@ const FriendsListScreen: React.FC = ({route}) => { }; const styles = StyleSheet.create({ - background: { - backgroundColor: 'white', - height: '100%', - }, backButton: { marginLeft: 10, }, diff --git a/src/screens/profile/index.ts b/src/screens/profile/index.ts index d5377494..ea0505a2 100644 --- a/src/screens/profile/index.ts +++ b/src/screens/profile/index.ts @@ -12,3 +12,4 @@ export {default as PrivacyScreen} from './PrivacyScreen'; export {default as AccountType} from './AccountType'; export {default as CategorySelection} from './CategorySelection'; export {default as CreateCustomCategory} from './CreateCustomCategory'; +export {default as CommentReactionScreen} from './CommentReactionScreen'; -- cgit v1.2.3-70-g09d2