From 593347d11dfa0d7c9d32cb79c2639041ce07d849 Mon Sep 17 00:00:00 2001 From: Ivan Chen Date: Tue, 16 Mar 2021 13:11:06 -0400 Subject: using s3 url instead of image passed from backend --- src/components/profile/Avatar.tsx | 7 ++----- src/components/profile/Cover.tsx | 11 ++++------- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src/components/profile') diff --git a/src/components/profile/Avatar.tsx b/src/components/profile/Avatar.tsx index ba4ec36c..5d677983 100644 --- a/src/components/profile/Avatar.tsx +++ b/src/components/profile/Avatar.tsx @@ -19,11 +19,8 @@ const Avatar: React.FC = ({style, screenType, userXId}) => { return ( ); }; diff --git a/src/components/profile/Cover.tsx b/src/components/profile/Cover.tsx index a03ef123..b7502cff 100644 --- a/src/components/profile/Cover.tsx +++ b/src/components/profile/Cover.tsx @@ -1,7 +1,7 @@ import React from 'react'; import {Image, StyleSheet, View} from 'react-native'; -import {IMAGE_WIDTH, COVER_HEIGHT, IMAGE_HEIGHT} from '../../constants'; import {useSelector} from 'react-redux'; +import {COVER_HEIGHT, IMAGE_WIDTH} from '../../constants'; import {RootState} from '../../store/rootreducer'; import {ScreenType} from '../../types'; @@ -10,7 +10,7 @@ interface CoverProps { screenType: ScreenType; } const Cover: React.FC = ({userXId, screenType}) => { - const {cover = ''} = userXId + const {cover} = userXId ? useSelector((state: RootState) => state.userX[screenType][userXId]) : useSelector((state: RootState) => state.user); @@ -18,11 +18,8 @@ const Cover: React.FC = ({userXId, screenType}) => { ); -- cgit v1.2.3-70-g09d2 From 0187200d794d54c1d9954dd86a6a156132dedcac Mon Sep 17 00:00:00 2001 From: ankit-thanekar007 Date: Mon, 22 Mar 2021 12:18:12 -0700 Subject: TMA 642 Touchable Opacity redirection --- src/components/moments/MomentPostHeader.tsx | 20 ++++++++++++++++---- src/components/profile/Content.tsx | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src/components/profile') diff --git a/src/components/moments/MomentPostHeader.tsx b/src/components/moments/MomentPostHeader.tsx index aad776e8..56b073d6 100644 --- a/src/components/moments/MomentPostHeader.tsx +++ b/src/components/moments/MomentPostHeader.tsx @@ -1,5 +1,11 @@ import React, {useState} from 'react'; -import {StyleSheet, Text, View, ViewProps} from 'react-native'; +import { + StyleSheet, + Text, + TouchableOpacity, + View, + ViewProps, +} from 'react-native'; import {MomentMoreInfoDrawer} from '../profile'; import {loadUserMoments} from '../../store/actions'; import {useDispatch, useSelector} from 'react-redux'; @@ -29,17 +35,23 @@ const MomentPostHeader: React.FC = ({ (state: RootState) => state.user.user, ); const isOwnProfile = loggedInUserName === username; - return ( - + { + navigation.navigate('Profile', { + userXId: isOwnProfile ? undefined : userXId, + screenType, + }); + }} + style={styles.header}> {username} - + = ({y, userXId, screenType}) => { isBlocked, }} /> - + {userXId && moments.length === 0 && ( -- cgit v1.2.3-70-g09d2 From 81b97d55e0b65e1df51cf65871d69e32ae48b5d0 Mon Sep 17 00:00:00 2001 From: ankit-thanekar007 Date: Tue, 23 Mar 2021 11:59:00 -0700 Subject: User not present check --- src/components/notifications/Notification.tsx | 45 ++++++++++++++++++++------- src/components/profile/Content.tsx | 12 ++++--- 2 files changed, 41 insertions(+), 16 deletions(-) (limited to 'src/components/profile') diff --git a/src/components/notifications/Notification.tsx b/src/components/notifications/Notification.tsx index c8a8aa06..8143e396 100644 --- a/src/components/notifications/Notification.tsx +++ b/src/components/notifications/Notification.tsx @@ -205,11 +205,22 @@ const Notification: React.FC = (props) => { dispatch(loadUserNotifications()); }; + const isOwnProfile = id === loggedInUser.userId; + const navigateToProfile = async () => { + if (!userXInStore(state, screenType, id)) { + await fetchUserX(dispatch, {userId: id, username: username}, screenType); + } + navigation.navigate('Profile', { + userXId: isOwnProfile ? undefined : id, + screenType, + }); + }; + const renderContent = () => ( - - + + = (props) => { : require('../../assets/images/avatar-placeholder.png') } /> - + - - {first_name} {last_name} - - {verbage} + + + {first_name} {last_name} + + + + {verbage} + {notification_type === 'FRD_REQ' && ( @@ -238,9 +253,13 @@ const Notification: React.FC = (props) => { notification_type === 'MOM_3+' || notification_type === 'MOM_FRIEND') && notification_object && ( - + + + )} - + ); return unread ? ( @@ -284,7 +303,6 @@ const styles = StyleSheet.create({ fontWeight: '700', }, moment: { - position: 'absolute', height: 42, width: 42, right: '5%', @@ -292,6 +310,9 @@ const styles = StyleSheet.create({ buttonsContainer: { height: '80%', }, + imageFlex: { + flex: 1, + }, }); export default Notification; diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx index 7f922bd9..1a5a205c 100644 --- a/src/components/profile/Content.tsx +++ b/src/components/profile/Content.tsx @@ -109,9 +109,10 @@ const Content: React.FC = ({y, userXId, screenType}) => { const [isStageOnePromptClosed, setIsStageOnePromptClosed] = useState( false, ); - const [isStageThreePromptClosed, setIsStageThreePromptClosed] = useState< - boolean - >(false); + const [ + isStageThreePromptClosed, + setIsStageThreePromptClosed, + ] = useState(false); const onRefresh = useCallback(() => { const refrestState = async () => { @@ -308,7 +309,10 @@ const Content: React.FC = ({y, userXId, screenType}) => { isBlocked, }} /> - + {userXId && moments.length === 0 && ( -- cgit v1.2.3-70-g09d2