diff options
| author | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-03-22 12:18:12 -0700 |
|---|---|---|
| committer | ankit-thanekar007 <ankit.thanekar007@gmail.com> | 2021-03-23 12:06:00 -0700 |
| commit | 0187200d794d54c1d9954dd86a6a156132dedcac (patch) | |
| tree | ff498f2703eb8037b550af4f03c895401ed72f8f /src/components/moments/MomentPostHeader.tsx | |
| parent | 33c107f7382955f6993d8415f08262f51060d178 (diff) | |
TMA 642 Touchable Opacity redirection
Diffstat (limited to 'src/components/moments/MomentPostHeader.tsx')
| -rw-r--r-- | src/components/moments/MomentPostHeader.tsx | 20 |
1 files changed, 16 insertions, 4 deletions
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<MomentPostHeaderProps> = ({ (state: RootState) => state.user.user, ); const isOwnProfile = loggedInUserName === username; - return ( <View style={[styles.container, style]}> - <View style={styles.header}> + <TouchableOpacity + onPress={() => { + navigation.navigate('Profile', { + userXId: isOwnProfile ? undefined : userXId, + screenType, + }); + }} + style={styles.header}> <Avatar style={styles.avatar} userXId={userXId} screenType={screenType} /> <Text style={styles.headerText}>{username}</Text> - </View> + </TouchableOpacity> <MomentMoreInfoDrawer isOpen={drawerVisible} setIsOpen={setDrawerVisible} |
