Skip to content
Snippets Groups Projects
Commit c52191c3 authored by Matt Kirby's avatar Matt Kirby
Browse files

Added new LikeStack logic

parent 8ca0fe22
No related branches found
No related tags found
1 merge request!8create "Basic components"
...@@ -38,7 +38,7 @@ const AnswerCard: FC<PropsWithChildren<AnswerCardProps>> = ({ ...@@ -38,7 +38,7 @@ const AnswerCard: FC<PropsWithChildren<AnswerCardProps>> = ({
<ChatBubbleLeftIcon className="h-6 w-6" aria-hidden="true"/> <ChatBubbleLeftIcon className="h-6 w-6" aria-hidden="true"/>
</button> </button>
</div> </div>
<LikeStack Users={[]} /> <LikeStack Users={[post.User, post.User, post.User, post.User, post.User]} />
</div> </div>
</div> </div>
......
...@@ -12,26 +12,28 @@ const LikeStack:FC<PropsWithChildren<LikeStackProps>> = ({ ...@@ -12,26 +12,28 @@ const LikeStack:FC<PropsWithChildren<LikeStackProps>> = ({
return ( return (
<> <>
<div className="flex -space-x-1 overflow-hidden items-center"> <div className="flex -space-x-1 overflow-hidden items-center">
<img {Users.map((user, index) => {
className="inline-block h-6 w-6 rounded-full ring-2 ring-white" if(index < 3){
src="https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" return (
alt="" <div>
/> <img
<img className="inline-block h-6 w-6 rounded-full ring-2 ring-white"
className="inline-block h-6 w-6 rounded-full ring-2 ring-white" src={user.Avatar}
src="https://images.unsplash.com/photo-1550525811-e5869dd03032?ixlib=rb-1.2.1&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" alt=""
alt="" />
/> </div>
<img )
className="inline-block h-6 w-6 rounded-full ring-2 ring-white" } else if (index === 3) {
src="https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2.25&w=256&h=256&q=80" return (
alt="" <div className="inline-block h-6 w-6 rounded-full ring-2 ring-white bg-gray-100 flex items-center justify-center">
/> <p className="text-c-pink text-xs">{`+${Users.length - 3}`}</p>
<img </div>
className="inline-block h-6 w-6 rounded-full ring-2 ring-white" )
src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80" } else {
alt="" return (null)
/> }
})}
</div> </div>
</> </>
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment