Feed showing posts
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { StatusBar } from 'expo-status-bar';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Text, View, ScrollView, Button } from 'react-native';
|
||||
import { Text, View, ScrollView, Button, StyleSheet } from 'react-native';
|
||||
import API from './../API.js';
|
||||
import Post from './Post.js'
|
||||
|
||||
|
||||
let Feed = () => {
|
||||
@@ -11,18 +12,18 @@ let Feed = () => {
|
||||
let r = await API.getMe();
|
||||
setMeProfile(r);
|
||||
let posts = await API.getPosts();
|
||||
setPosts(posts)
|
||||
setPosts(posts);
|
||||
//console.log(posts)
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<View>
|
||||
<ScrollView>
|
||||
<Text>Hello: {Me.profile && Me.profile.firstName} {Me.profile && Me.profile.lastName}</Text>
|
||||
{
|
||||
Posts.map((post, i) => {
|
||||
return (
|
||||
<Text key={i}>{post.content}</Text>
|
||||
//<Text key={i}>{post.content}</Text>
|
||||
<Post post={post} key={i}/>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user