Updating useeffect

This commit is contained in:
aeroreyna
2022-11-21 15:15:28 -05:00
parent a313822c27
commit 1972aa7464
6 changed files with 27 additions and 15 deletions

View File

@@ -34,6 +34,7 @@ let LoginForm = () => {
onChangeText={text => setEmail(text)}
defaultValue={email}
placeholder="email"
label="email:"
autoCapitalize='none'
autoComplete='email'
autoCorrect={false}
@@ -45,6 +46,7 @@ let LoginForm = () => {
defaultValue={password}
placeholder="password"
textContentType="password"
label="password:"
secureTextEntry={true}
autoCapitalize='none'
autoComplete='email'
@@ -68,7 +70,7 @@ const styles = StyleSheet.create({
backgroundColor: 'white',
flex: 1,
flexDirection: "column",
justifyContent: "flex-start",
justifyContent: "center",
padding: 15,
width: "100%",
alignContent: 'center',

View File

@@ -1,7 +1,7 @@
import React, { useState, useEffect } from 'react';
import { Text, ScrollView, FlatList, StyleSheet, View, Linking } from 'react-native';
import React, { useState } from 'react';
import { Text, ScrollView, FlatList, StyleSheet, View } from 'react-native';
import Hyperlink from 'react-native-hyperlink'
import { Avatar, Button, Card, Title, Chip } from 'react-native-paper';
import { Button, Card, Chip } from 'react-native-paper';
import API from './../API.js';
import UserName from './UserName.js';
import Media from './Media.js';
@@ -62,7 +62,7 @@ let Post = (props) => {
{!post.nonOrganicType ?
<View>
<Text style={styles.userName}>
<UserName profileid={post.profileid} />
<UserName profileid={post.profileid}/>
{toProfileText}
<Text style={{ fontWeight: 'normal', fontSize: 12 }}>
{" " + Moment(post.createdAt).fromNow()}

View File

@@ -36,7 +36,8 @@ let UserName = ({ profileid, hideIcon }) => {
let p = await API.getUserProfile(profileid).catch(() => { return {} });
if (subscribed)
setProfile(p);
storeName(profileid, p)
storeName(profileid, p);
console.log("Fetching Name:" + p?.profile?.firstName);
}
getData();
return () => {