Open comments on singlepost view
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { ScrollView } from 'react-native';
|
||||
import { FlatList } from 'react-native';
|
||||
import API from './../API.js';
|
||||
import Post from './Post.js';
|
||||
|
||||
let SinglePostComponent = ({ postId }) => {
|
||||
let SinglePostComponent = ({ postId, hideComments }) => {
|
||||
let [post, setPost] = useState({});
|
||||
useEffect(() => {
|
||||
let subscribed = true;
|
||||
@@ -19,9 +19,12 @@ let SinglePostComponent = ({ postId }) => {
|
||||
}
|
||||
}, [postId]);
|
||||
return (post._id ? (
|
||||
<ScrollView>
|
||||
<Post post={post}/>
|
||||
</ScrollView>
|
||||
<FlatList
|
||||
data={[post]}
|
||||
renderItem={({ item }) => <Post post={item} showComments={hideComments ? false : true}/>}
|
||||
keyExtractor={item => item._id}
|
||||
/>
|
||||
|
||||
) : null);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user