Skip to content

Commit

Permalink
Merge pull request #185 from Dorcas-BD/feat/HNG-86-components-blog-cards
Browse files Browse the repository at this point in the history
[FEAT] Components -> Blog cards #86
  • Loading branch information
chumex412 authored Jul 20, 2024
2 parents 0c94655 + 1dd116d commit 3a82f7b
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions app/components/BlogCards.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React from "react";

interface BlogCardProps {

Check failure on line 3 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

The variable `BlogCardProps` should be named `BlogCardProperties`. A more descriptive name will do too
title: string;
description: string;
date: string;
authorName: string;
authorProfilePicture: string;
tag: string;
timeOfReading: string;
blogImage: string;
link: string;
}

const BlogCard: React.FC<BlogCardProps> = ({
title,
description,
date,
authorName,
authorProfilePicture,
tag,
timeOfReading,
blogImage,
link,
}) => {
return (
<div className="max-w-sm lg:max-w-full lg:flex lg:flex-row rounded overflow-hidden shadow-lg m-4">

Check failure on line 27 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `ax-w-sm·lg:max-w-full·lg:flex·lg:flex-row·rounded·overflow-hidden·shadow-lg·m-4` with `-4·max-w-sm·overflow-hidden·rounded·shadow-lg·lg:flex·lg:max-w-full·lg:flex-row`
<img className="w-full lg:w-1/3 lg:order-2" src={blogImage} alt={title} />

Check failure on line 28 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `w-1/3·lg:order-2` with `order-2·lg:w-1/3`
<div className="p-4 lg:w-2/3 lg:order-1">

Check failure on line 29 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `w-2/3·lg:order-1` with `order-1·lg:w-2/3`
<div className="flex items-center mb-2">

Check failure on line 30 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `flex·items-center·mb-2` with `mb-2·flex·items-center`
<span className="inline-block w-3 h-3 rounded-full bg-gray-400 mr-2"></span>

Check failure on line 31 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `inline-block·w-3·h-3·rounded-full·bg-gray-400·mr-2` with `mr-2·inline-block·h-3·w-3·rounded-full·bg-gray-400`
<span className="text-sm font-semibold text-gray-700">{tag}</span>
</div>
<div>
<a href={link} className="text-black hover:text-blue-800">
<h3 className="font-bold text-xl mb-2">{title}</h3>

Check failure on line 36 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `font-bold·text-xl·mb-2` with `mb-2·text-xl·font-bold`
</a>
<p className="text-gray-700 text-base mb-4">{description}</p>

Check failure on line 38 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `text-gray-700·text-base·mb-4` with `mb-4·text-base·text-gray-700`
</div>
<div className="flex justify-between text-gray-500 text-sm mb-4">

Check failure on line 40 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `flex·justify-between·text-gray-500·text-sm·mb-4` with `mb-4·flex·justify-between·text-sm·text-gray-500`
<span>{date}</span>
<span>{timeOfReading} mins Read</span>
</div>
<div className="flex items-center">
<img
className="w-10 h-10 rounded-full mr-4"

Check failure on line 46 in app/components/BlogCards.tsx

View workflow job for this annotation

GitHub Actions / build

Replace `w-10·h-10·rounded-full·mr-4` with `mr-4·h-10·w-10·rounded-full`
src={authorProfilePicture}
alt={authorName}
/>
<div className="text-sm">
<p className="text-gray-900 leading-none">{authorName}</p>
</div>
</div>
</div>
</div>
);
};

export default BlogCard;
Binary file added public/blogImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/profileImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3a82f7b

Please sign in to comment.