-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
51bc3e7
commit 0a1fa6c
Showing
3 changed files
with
64 additions
and
27 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,42 @@ | ||
import Image from 'next/image'; | ||
|
||
interface ImageCardProps { | ||
imageUrl: string; | ||
imageAlt: string; | ||
children: React.ReactNode; | ||
imageFirst?: boolean; | ||
imageWidth?: number; | ||
imageHeight?: number; | ||
} | ||
|
||
export function ImageCard({ | ||
imageUrl, | ||
imageAlt, | ||
children, | ||
imageFirst = true, | ||
imageWidth = 0, | ||
imageHeight = 0, | ||
}: ImageCardProps) { | ||
return ( | ||
<div className="image-card grid grid-cols-1 justify-items-center gap-4 xl:grid-cols-[1fr_2fr] xl:justify-items-start xl:gap-14"> | ||
<div | ||
className={`image-box h-[100%] w-[30rem] overflow-hidden ${ | ||
imageFirst ? 'order-1' : 'order-1 xl:order-2' | ||
}`} | ||
> | ||
<Image | ||
className="h-full w-full object-cover" | ||
src={imageUrl} | ||
width={imageWidth} | ||
height={imageHeight} | ||
alt={imageAlt} | ||
/> | ||
</div> | ||
<div | ||
className={`text-box order-2 flex flex-col gap-5 ${imageFirst ? '' : 'xl:order-1'}`} | ||
> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
} |
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