All files / Rindu/components/BigPill BigPill.tsx

100% Statements 3/3
100% Branches 1/1
100% Functions 1/1
100% Lines 3/3

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 68 69 70 71 72 73 74 75 76 77    19x   19x                 2x                                                                                                                              
import { ReactElement } from "react";
 
import Link from "next/link";
 
import { Eyebrow, Heading } from "components";
 
interface BigPillProps {
  img?: string;
  title: string;
  subTitle: string;
  href: string;
}
 
export default function BigPill({
  img,
  title,
  subTitle,
  href,
}: Readonly<BigPillProps>): ReactElement {
  return (
    <Link href={href} className="BigPill">
      {img ? (
        // eslint-disable-next-line @next/next/no-img-element
        <img className="img" src={img} alt={title} />
      ) : (
        <div className="img"></div>
      )}
      <div className="big-pill-content">
        <Eyebrow size="medium">{title}</Eyebrow>
        <Heading number={3} as={"h2"}>
          {subTitle}
        </Heading>
      </div>
      <style jsx>{`
        :global(.BigPill) {
          display: flex;
          align-items: center;
          width: 100%;
          height: 100%;
          background-color: transparent;
          border-radius: 8px;
          position: relative;
          z-index: 1;
          gap: 20px;
          text-decoration: none;
          color: inherit;
          padding: 10px;
        }
        :global(.BigPill:hover),
        :global(.BigPill:focus) {
          background-color: rgba(255, 255, 255, 0.1);
        }
        :global(.BigPill) .img {
          width: 100px;
          min-width: 100px;
          min-height: 100px;
          height: 100px;
          border-radius: 50%;
          object-fit: cover;
          object-position: center center;
        }
        .big-pill-content {
          display: flex;
          flex-direction: column;
          width: 100%;
          height: 100%;
        }
        @media (max-width: 768px) {
          :global(.BigPill) {
            padding: 8px;
          }
        }
      `}</style>
    </Link>
  );
}