TabBar Navigator and Proper adding posts and comments

This commit is contained in:
aeroreyna
2022-03-08 20:20:17 -08:00
parent 983ac258b3
commit 82e0ded56c
8 changed files with 121 additions and 47 deletions

View File

@@ -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>