diff --git a/Views/Feed.js b/Views/Feed.js index d207649..eed0c6b 100644 --- a/Views/Feed.js +++ b/Views/Feed.js @@ -59,8 +59,6 @@ const styles = StyleSheet.create({ container: { flex: 1, alignItems: 'center', - justifyContent: 'center', backgroundColor: "#edf2f7", - width: "100%" }, }); diff --git a/components/Comment.js b/components/Comment.js index 856b26a..d0c74de 100644 --- a/components/Comment.js +++ b/components/Comment.js @@ -4,22 +4,29 @@ import { FAB, Button, Card, Title, IconButton } from 'react-native-paper'; import API from './../API.js'; import UserName from './UserName.js'; import Media from './Media.js'; +import AwesomeIcon from 'react-native-vector-icons/FontAwesome'; let Comment = ({ comment }) => { return ( - - - + + + ); +} + +export default NewComment; + +const styles = StyleSheet.create({ + NewComment: { + margin: 10, + flexDirection: "row", + flex: 6 + } +}); \ No newline at end of file diff --git a/components/Post.js b/components/Post.js index 06f950e..e6f15fa 100644 --- a/components/Post.js +++ b/components/Post.js @@ -5,13 +5,22 @@ import API from './../API.js'; import UserName from './UserName.js'; import Media from './Media.js'; import Comment from "./Comment"; +import NewComment from './NewComment.js'; -let Post = ({ post, viewer }) => { +let Post = (props) => { + const viewer = props.viewer; let [showCommentsB, changeshowCommentsB] = useState(false); + let [post, changePost] = useState(props.post); let toProfileText = post.toProfile && post.toProfile !== post.profileid ? {">"} : undefined; let cleanContent = post.content.replace(/@[A-z]+:.+\w/g, ''); + const newComentAdded = (commentData) => { + //add to comments + props.post.comments.push(commentData); + changePost(props.post); + console.log(commentData); + }; return ( @@ -19,21 +28,24 @@ let Post = ({ post, viewer }) => { {toProfileText} - {cleanContent} + {cleanContent} - - - - - + + + + + + {showCommentsB && } { showCommentsB && - post.comments.map((comment, i) => { - return - }) + ( + post.comments.map((comment, i) => { + return + }) + ) } ); @@ -46,6 +58,7 @@ const styles = StyleSheet.create({ fontSize: 14, fontWeight: 'bold', marginBottom: 5, + fontSize: 18, }, card: { margin: 8,