Skip to content

Instantly share code, notes, and snippets.

@Olanetsoft
Created April 26, 2022 09:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Olanetsoft/d0270f1bba5ded06903b83b21f072979 to your computer and use it in GitHub Desktop.
Save Olanetsoft/d0270f1bba5ded06903b83b21f072979 to your computer and use it in GitHub Desktop.
import React from "react";
import { BiCheck } from "react-icons/bi";
export default function FeedList({ horizontal, feed }) {
return (
<div
className={`${
horizontal
? "flex flex-row mx-5 mb-5 item-center justify-center"
: "flex flex-col m-5"
} `}
>
<img
className={
horizontal
? "object-cover rounded-lg w-60 h-40"
: "object-cover rounded-lg w-full h-40"
}
src={`https://ipfs.infura.io/ipfs/${feed.coverImageHash}`}
alt="cover"
/>
<div className={horizontal && "ml-3 w-80"}>
<h4 className="text-md font-bold dark:text-white mt-3 text-black">
{feed.title}
</h4>
{horizontal && (
<p className="text-sm flex items-center text-textSubTitle mt-1">
{feed.category}
</p>
)}
{horizontal && (
<p className="text-sm flex items-center text-textSubTitle mt-1">
{feed.description.slice(0, 30)}...
</p>
)}
<p className="text-sm flex items-center text-textSubTitle mt-1">
{horizontal ? null : feed.category + " • "}
{feed?.author?.slice(0, 12)}...{" "}
<BiCheck size="20px" color="green" className="ml-1" />
</p>
</div>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment