-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
59 additions
and
32 deletions.
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,51 @@ | ||
import Image from 'next/image' | ||
import Link from '@/components/Link' | ||
|
||
const Card = ({ title, description, imgSrc, href }) => ( | ||
<div className="p-4 md:w-1/2 md" style={{ maxWidth: '544px' }}> | ||
<div className="h-full border-2 border-gray-200 border-opacity-60 dark:border-gray-700 rounded-md overflow-hidden"> | ||
{href ? ( | ||
<Link href={href} aria-label={`Link to ${title}`}> | ||
<Image | ||
alt={title} | ||
src={imgSrc} | ||
className="lg:h-48 md:h-36 object-cover object-center" | ||
width={544} | ||
height={306} | ||
/> | ||
</Link> | ||
) : ( | ||
<Image | ||
alt={title} | ||
src={imgSrc} | ||
className="lg:h-48 md:h-36 object-cover object-center" | ||
width={544} | ||
height={306} | ||
/> | ||
)} | ||
<div className="p-6"> | ||
<h2 className="text-2xl font-bold leading-8 tracking-tight mb-3"> | ||
{href ? ( | ||
<Link href={href} aria-label={`Link to ${title}`}> | ||
{title} | ||
</Link> | ||
) : ( | ||
title | ||
)} | ||
</h2> | ||
<p className="prose text-gray-500 max-w-none dark:text-gray-400 mb-3">{description}</p> | ||
{href && ( | ||
<Link | ||
href={href} | ||
className="text-base font-medium leading-6 text-blue-500 hover:text-blue-600 dark:hover:text-blue-400" | ||
aria-label={`Link to ${title}`} | ||
> | ||
Learn more → | ||
</Link> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
|
||
export default Card |
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
e91e693
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.
Successfully deployed to the following URLs: