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

intégration de la page 'feed' (qnd le feed est vide)

parent e47e30f5
Branches
Tags
No related merge requests found
import { useEffect } from 'react'; import { useEffect } from 'react';
import { Instalike } from '@jmetterrothan/instalike'; import { Instalike } from '@jmetterrothan/instalike';
// ICONS
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faHouse } from '@fortawesome/free-solid-svg-icons';
// COMPOSANTS // COMPOSANTS
import Navbar from '../components/Navbar'; import Navbar from '../components/Navbar';
import Suggestion from '../components/Suggestion'; import Suggestion from '../components/Suggestion';
...@@ -49,28 +53,36 @@ return <> ...@@ -49,28 +53,36 @@ return <>
}) })
} }
</ul> </ul>
<div className="flex flex-col gap-10 mt-10"> {feedItems && feedItems.length > 0 ? (
{/* POSTS */} <div className="flex flex-col gap-10 mt-10">
{feedItems && {/* POSTS */}
feedItems.map((post: Instalike.Post) => { {feedItems.map((post: Instalike.Post) => {
console.log(post) console.log(post)
return (
<Post key={post.id}
postid={post.id}
username={post.owner.userName}
location={post.location}
time_post={calculateTime(post.createdAt)}
img={post.resources[0]}
caption={post.caption}
isLiked={post.viewerHasLiked}
likes={post.likesCount}
comments={post.commentsCount}
comment_post={post.previewComments}
></Post>
);
})}
</div>
) : (
<div className="flex flex-col items-center gap-4 mt-20">
<FontAwesomeIcon className="text-[96px]" icon={faHouse} />
<p className="font-bold text-xl">Votre feed est vide</p>
<p>Vous devriez suivre des utilisateurs pour remplir votre feed...</p>
</div>
)}
return (
<Post key={post.id}
postid={post.id}
username={post.owner.userName}
location={post.location}
time_post={calculateTime(post.createdAt)}
img={post.resources[0]}
caption={post.caption}
isLiked={post.viewerHasLiked}
likes={post.likesCount}
comments={post.commentsCount}
comment_post={post.previewComments}
></Post>
);
})}
</div>
</div> </div>
</>; </>;
......
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