SponsorCard.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import classNames from "classnames"
  2. import Image from "next/legacy/image"
  3. import { FormattedMessage } from "react-intl"
  4. /** Sponsor Card, supporting data from `silver`, `generalHighlighted`, and `general` */
  5. const SponsorCard = ({ sponsor, tier }) => {
  6. return (
  7. <div
  8. className={classNames(
  9. "grid grid-cols-[auto_1fr] gap-4 rounded p-4",
  10. tier === "generalHighlighted" && "bg-nightshade-900 text-white",
  11. tier === "silver" && "border border-gray-3 hover:bg-gray-4"
  12. )}
  13. >
  14. {tier === "silver" && (
  15. <div className="relative h-[56px] w-[56px] overflow-hidden rounded-md bg-blurple-gradient">
  16. {sponsor.logo && (
  17. <Image src={sponsor.logo} alt="" layout="fill" objectFit="cover" />
  18. )}
  19. </div>
  20. )}
  21. <div
  22. className={classNames("truncate", tier !== "silver" ? "w-full" : null)}
  23. >
  24. <span
  25. className={classNames(
  26. "b3 !leading-[1.5]",
  27. tier === "generalHighlighted"
  28. ? "text-nightshade-100"
  29. : "text-gray-1"
  30. )}
  31. >
  32. {tier === "silver" ? (
  33. <FormattedMessage
  34. id="silver_sponsor"
  35. defaultMessage="Silver sponsor"
  36. />
  37. ) : (
  38. <FormattedMessage id="sponsor" defaultMessage="Sponsor" />
  39. )}
  40. </span>
  41. <p className="b2 truncate !font-semibold">{sponsor.name || sponsor}</p>
  42. </div>
  43. </div>
  44. )
  45. }
  46. export default SponsorCard