From 4c754dd37f0f9ecd332ceecfca07106825bbcecd Mon Sep 17 00:00:00 2001 From: SandraBergstrom Date: Sat, 24 Jun 2023 11:46:29 +0000 Subject: [PATCH] #15 Add post component to post page --- src/pages/posts/Post.js | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/pages/posts/Post.js diff --git a/src/pages/posts/Post.js b/src/pages/posts/Post.js new file mode 100644 index 0000000..7913d39 --- /dev/null +++ b/src/pages/posts/Post.js @@ -0,0 +1,42 @@ +import React from "react"; +import {useCurrentUser} from "../../contexts/CurrentUserContext" + +import styles from "../../styles/Post.module.css"; +import Card from 'react-bootstrap/Card'; +import { Media } from "react-bootstrap"; +import { Link } from "react-router-dom"; +import Avatar from "../../components/Avatar" + +const Post = (props) => { + const { + id, + owner, + traveler_id, + traveler_image, + comments_count, + likes_count, + like_id, + title, + content, + image, + updated_at, + postPage, + } = props; + + const currentUser = useCurrentUser; + const is_owner = currentUser?.username === owner; + + return ( + + + + + + + + + + ); +}; + +export default Post;