-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/hng 26 latest article card component #221
Closed
Adufe-Obanijesu
wants to merge
10
commits into
hngprojects:dev
from
Adufe-Obanijesu:feat/HNG-26-latest-article-card-component
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4c63b0a
feat: develop the latest article card component
Adufe-Obanijesu 9ec0ad9
fix: fix the image overflow and make the article card into a link
Adufe-Obanijesu d4ee4b6
fix: fix conflicts in pnpm-lock.yaml
Adufe-Obanijesu 6a1459f
fix: fix the grid layout for desktop view
Adufe-Obanijesu 90dfa05
fix: fix the letter spacing of description
Adufe-Obanijesu 0f66fbb
fix: fix lint errors
Adufe-Obanijesu 9867b6c
fix: added id to the article interface
Adufe-Obanijesu 59d631a
fix: added dot before the creation date
Adufe-Obanijesu 73556ff
fix: fix lint error
Adufe-Obanijesu 953855f
fix: use global styles
Adufe-Obanijesu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { Link } from "@remix-run/react"; | ||
|
||
interface articleProperties { | ||
id: string; | ||
title: string; | ||
description: string; | ||
profileImage: string; | ||
name: string; | ||
time: string; | ||
creationDate: string; | ||
image: string; | ||
link: string; | ||
tag: string; | ||
} | ||
|
||
export default function LatestArticle({ | ||
article, | ||
}: { | ||
article: articleProperties; | ||
}) { | ||
return ( | ||
<Link to={article.link}> | ||
<article className="max-w-[792px] bg-[#fafafa] text-muted-foreground"> | ||
<div className="grid gap-6 py-4 md:grid-cols-5 md:py-8"> | ||
<div className="order-2 space-y-2 md:order-1 md:col-span-3 md:space-y-4"> | ||
<span className="inline-flex items-center justify-center gap-1.5 rounded-full bg-border py-1 pl-2.5 pr-3 text-xs font-[700]"> | ||
<span className="h-2 w-2 rounded-full bg-black"></span> | ||
<div className="uppercase">{article.tag}</div> | ||
</span> | ||
|
||
<h3 className="text-xl font-[700] capitalize leading-[normal] tracking-wider md:text-3xl md:font-[600]"> | ||
{article.title} | ||
</h3> | ||
|
||
<p className="text-base font-[400] leading-[normal] tracking-wide md:text-lg"> | ||
{article.description} | ||
</p> | ||
|
||
<div className="flex flex-wrap items-center gap-4 text-base font-[500] md:justify-between md:gap-0 md:text-lg"> | ||
<div className="order-3 flex w-full items-center gap-3 md:order-1 md:w-auto"> | ||
<img | ||
src={article.profileImage} | ||
alt={article.name} | ||
className="h-8 w-8 rounded-full object-cover object-top md:h-10 md:w-10" | ||
/> | ||
<p className="">{article.name}</p> | ||
</div> | ||
<p className="order-1 md:order-2">{article.time} Read</p> | ||
|
||
<p className="order-2 flex items-center justify-center gap-4 md:order-3"> | ||
<span className="h-2 w-2 rounded-full bg-border"></span> | ||
<span>{article.creationDate}</span> | ||
</p> | ||
</div> | ||
</div> | ||
<div className="order-1 flex md:order-2 md:col-span-2 md:items-end"> | ||
<img | ||
src={article.image} | ||
alt={article.title} | ||
className="md:rounded-2 h-60 w-full rounded-lg object-cover md:h-60" | ||
/> | ||
</div> | ||
</div> | ||
</article> | ||
</Link> | ||
); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use global styles