TabBar Navigator and Proper adding posts and comments
This commit is contained in:
@@ -5,7 +5,7 @@ import API from './../API.js';
|
||||
import { useNavigation } from '@react-navigation/native';
|
||||
|
||||
|
||||
let NewPost = () => {
|
||||
let NewPost = ({profileid, newPostCB}) => {
|
||||
let [postContent, setPostContent] = useState('');
|
||||
const navigation = useNavigation();
|
||||
|
||||
@@ -23,9 +23,10 @@ let NewPost = () => {
|
||||
<View style={{ flexDirection: "row", justifyContent: 'flex-end' }}>
|
||||
<Button icon="add-a-photo" mode="outlined"></Button>
|
||||
<Button icon="send" mode="outlined" onPress={() => {
|
||||
setPostContent('');
|
||||
API.newPost(postContent).then((newPost) => {
|
||||
console.log(newPost);
|
||||
setPostContent('')
|
||||
setPostContent('');
|
||||
if(newPostCB) newPostCB(newPost);
|
||||
});
|
||||
}}>Post</Button>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user