Feed showing posts
This commit is contained in:
22
components/UserName.js
Normal file
22
components/UserName.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Text, View, ScrollView, Button, StyleSheet } from 'react-native';
|
||||
import API from './../API.js';
|
||||
|
||||
|
||||
let UserName = (props) => {
|
||||
let [profile, setProfile] = useState({});
|
||||
|
||||
useEffect(async () => {
|
||||
let p = await API.getUserProfile(props.profileid).catch(()=>{return {}});
|
||||
setProfile(p);
|
||||
}, [props.profileid]);
|
||||
|
||||
return (
|
||||
<Text>{profile.profile && profile.profile.firstName} {profile.profile && profile.profile.lastName}</Text>
|
||||
);
|
||||
}
|
||||
|
||||
export default UserName;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
});
|
||||
Reference in New Issue
Block a user