fix: allow proj img to be optional

This commit is contained in:
Timothy Lin 2021-12-27 15:04:38 +08:00
parent 9c299df2f1
commit 5d77b1fc24

View File

@ -3,8 +3,13 @@ import Link from './Link'
const Card = ({ title, description, imgSrc, href }) => ( const Card = ({ title, description, imgSrc, href }) => (
<div className="p-4 md:w-1/2 md" style={{ maxWidth: '544px' }}> <div className="p-4 md:w-1/2 md" style={{ maxWidth: '544px' }}>
<div className="h-full overflow-hidden border-2 border-gray-200 rounded-md border-opacity-60 dark:border-gray-700"> <div
{href ? ( className={`${
imgSrc && 'h-full'
} overflow-hidden border-2 border-gray-200 rounded-md border-opacity-60 dark:border-gray-700`}
>
{imgSrc &&
(href ? (
<Link href={href} aria-label={`Link to ${title}`}> <Link href={href} aria-label={`Link to ${title}`}>
<Image <Image
alt={title} alt={title}
@ -22,7 +27,7 @@ const Card = ({ title, description, imgSrc, href }) => (
width={544} width={544}
height={306} height={306}
/> />
)} ))}
<div className="p-6"> <div className="p-6">
<h2 className="mb-3 text-2xl font-bold leading-8 tracking-tight"> <h2 className="mb-3 text-2xl font-bold leading-8 tracking-tight">
{href ? ( {href ? (