Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | 19x | import { ReactElement } from "react";
import { CardContainer } from "components";
interface IFeatureCard {
eyeBrowText: string;
titleText: string;
description: string;
imageSrc: string;
imageAlt: string;
onCTAClick: () => void;
ctaText: string;
}
export default function FeatureCard({
eyeBrowText,
titleText,
description,
imageSrc,
imageAlt,
onCTAClick,
ctaText,
}: IFeatureCard): ReactElement {
return (
<CardContainer className="featured-card">
<div className="image">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img src={imageSrc} alt={imageAlt} width={500} />
</div>
<div className="data">
<span>{eyeBrowText}</span>
<h2>{titleText}</h2>
<p>{description}</p>
<button onClick={onCTAClick}>{ctaText}</button>
</div>
<style jsx>{`
img {
margin: 0 auto;
position: relative;
}
.image {
display: grid;
}
@media screen and (min-width: 0px) and (max-width: 1100px) {
img {
transform: translateY(0px);
width: 100%;
}
.data,
:global(.featured-card:nth-child(even)) .image,
:global(.featured-card:nth-child(odd)) .image {
padding: 0;
}
.data {
margin: 20px 0;
padding: 0;
}
:global(.featured-card:nth-child(even)) {
display: flex;
flex-direction: column-reverse;
}
}
`}</style>
</CardContainer>
);
}
|