23 lines
598 B
JavaScript
23 lines
598 B
JavaScript
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({
|
|
});
|