Skip to content
Snippets Groups Projects
Commit bdc203cd authored by Chloé JACOB's avatar Chloé JACOB :alien:
Browse files

quelques modifications

parent f736f7d5
Branches
Tags
No related merge requests found
...@@ -35,7 +35,7 @@ const dispatch = useAppDispatch(); ...@@ -35,7 +35,7 @@ const dispatch = useAppDispatch();
return <> return <>
{/* A POST */} {/* A POST */}
<div className="border rounded-xl mt-10 bg-white"> <div className="border rounded-xl bg-white">
{/* HEADER POST */} {/* HEADER POST */}
<div className="flex justify-between p-4"> <div className="flex justify-between p-4">
<div className="flex items-center gap-4"> <div className="flex items-center gap-4">
......
...@@ -5,7 +5,6 @@ import { Instalike } from '@jmetterrothan/instalike'; ...@@ -5,7 +5,6 @@ import { Instalike } from '@jmetterrothan/instalike';
import Navbar from '../components/Navbar'; import Navbar from '../components/Navbar';
import Suggestion from '../components/Suggestion'; import Suggestion from '../components/Suggestion';
import Post from '../components/Post'; import Post from '../components/Post';
// import { Link } from 'react-router-dom';
// AUTRES FICHIERS // AUTRES FICHIERS
import useAppDispatch from '../hooks/useAppDispatch'; import useAppDispatch from '../hooks/useAppDispatch';
...@@ -34,7 +33,7 @@ const FeedView = () => { ...@@ -34,7 +33,7 @@ const FeedView = () => {
return <> return <>
{/* HEADER */} {/* HEADER */}
<Navbar /> <Navbar />
{/* FEED */} {/* FEEDVIEW */}
<div className="max-w-[640px] mx-auto mt-8 mb-16 px-4"> <div className="max-w-[640px] mx-auto mt-8 mb-16 px-4">
{/* USERS / STORIES */} {/* USERS / STORIES */}
<ul className="flex gap-8"> <ul className="flex gap-8">
...@@ -50,13 +49,13 @@ return <> ...@@ -50,13 +49,13 @@ return <>
}) })
} }
</ul> </ul>
{/* POSTS */} <div className="flex flex-col gap-10 mt-10">
{feedItems && {/* POSTS */}
feedItems.map((post: Instalike.Post) => { {feedItems &&
console.log(post) feedItems.map((post: Instalike.Post) => {
console.log(post)
return ( return (
// <Link key={post.id} to={`/post/${post.id}`}>
<Post key={post.id} <Post key={post.id}
postid={post.id} postid={post.id}
username={post.owner.userName} username={post.owner.userName}
...@@ -69,9 +68,9 @@ return <> ...@@ -69,9 +68,9 @@ return <>
comments={post.commentsCount} comments={post.commentsCount}
comment_post={post.previewComments} comment_post={post.previewComments}
></Post> ></Post>
// </Link> );
); })}
})} </div>
</div> </div>
</>; </>;
......
import { useEffect } from 'react'; import { useEffect } from 'react';
import { Navigate, useParams } from 'react-router-dom'; import { Navigate, useParams } from 'react-router-dom';
// COMPOSANTS
import Post from '../components/Post';
import Navbar from '../components/Navbar';
// AUTRES FICHIERS
import useAppDispatch from '../hooks/useAppDispatch'; import useAppDispatch from '../hooks/useAppDispatch';
import usePost from '../hooks/usePostItems'; import usePost from '../hooks/usePostItems';
import { fetchPost, calculateTime } from '../redux/post/thunks'; import { fetchPost, calculateTime } from '../redux/post/thunks';
import Post from '../components/Post';
const usePostId = () => { const usePostId = () => {
...@@ -23,27 +28,29 @@ const PostView = () => { ...@@ -23,27 +28,29 @@ const PostView = () => {
return <Navigate to="feed" />; return <Navigate to="feed" />;
} }
return <> return <>
<div className="bg-gray-900/50 h-full"> <div className="h-full">
<div className="max-w-[640px] mx-auto py-16 px-4"> {/* HEADER */}
{/* A POST */} <Navbar />
{post && ( <div className="max-w-[640px] mx-auto py-16 px-4">
<Post key={post.id} {/* A POST */}
postid={post.id} {post && (
username={post.owner.userName} <Post key={post.id}
location={post.location} postid={post.id}
time_post={calculateTime(post.createdAt)} username={post.owner.userName}
img={post.resources[0]} location={post.location}
caption={post.caption} time_post={calculateTime(post.createdAt)}
isLiked={post.viewerHasLiked} img={post.resources[0]}
likes={post.likesCount} caption={post.caption}
comments={post.commentsCount} isLiked={post.viewerHasLiked}
comment_post={post.previewComments} likes={post.likesCount}
></Post> comments={post.commentsCount}
)} comment_post={post.previewComments}
></Post>
)}
</div>
</div> </div>
</div> </>;
</>;
}; };
export default PostView; export default PostView;
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment