Feed showing posts

This commit is contained in:
aeroreyna
2022-03-05 23:51:26 -08:00
parent 195e8f11ef
commit 352871786b
9 changed files with 259 additions and 9762 deletions

View File

@@ -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}/>
)
})
}