Basic Navigation
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Text, View, ScrollView, Button, StyleSheet } from 'react-native';
|
||||
import API from './../API.js';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
|
||||
|
||||
let UserName = (props) => {
|
||||
let [profile, setProfile] = useState({});
|
||||
const navigation = useNavigation();
|
||||
|
||||
useEffect(async () => {
|
||||
let p = await API.getUserProfile(props.profileid).catch(()=>{return {}});
|
||||
@@ -12,7 +14,7 @@ let UserName = (props) => {
|
||||
}, [props.profileid]);
|
||||
|
||||
return (
|
||||
<Text>{profile.profile && profile.profile.firstName} {profile.profile && profile.profile.lastName}</Text>
|
||||
<Text onPress={()=>{navigation.navigate('Feed', {profileid: props.profileid})}} >{profile.profile && profile.profile.firstName} {profile.profile && profile.profile.lastName}</Text>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user