Notifications view improvement and some cleaning

This commit is contained in:
Adolfo Reyna
2022-12-11 22:17:58 -05:00
parent 18a37c64c0
commit 90be0f05bb
6 changed files with 52 additions and 45 deletions
+3 -23
View File
@@ -1,29 +1,9 @@
import { StatusBar } from 'expo-status-bar';
import React, { useState, useEffect } from 'react';
import { View, Text, StyleSheet, ScrollView, FlatList } from 'react-native';
import API from './../API.js';
import Post from './../components/Post.js';
import React from 'react';
import SinglePostComponent from '../components/SinglePostComponent';
let SinglePost = ({ route }) => {
let [post, setPost] = useState({});
console.log(route.params.postid)
useEffect(async () => {
if (route.params.postid)
setPost(await API.getPost(route.params.postid));
}, [route]);
return (post._id ? (
<ScrollView>
<Post post={post}/>
</ScrollView>
) : null);
return <SinglePostComponent postId={route.params.postid} />;
};
export default SinglePost;
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
backgroundColor: "#edf2f7",
},
});