SponsorLogoGroup.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import Image from "next/legacy/image"
  2. import classnames from "classnames"
  3. const SponsorLogoGroup = ({ sponsors }) => {
  4. return (
  5. <div className="grid grid-cols-[repeat(auto-fill,minmax(16rem,1fr))] gap-1">
  6. {sponsors.map((sponsor, i) => {
  7. let isLastItem = sponsors[i + 1] == undefined
  8. let isUnevenItems = sponsors.length % 2 != 0
  9. return (
  10. <a
  11. href={sponsor.url}
  12. key={i}
  13. className={classnames(
  14. "group relative inline-flex items-center justify-center rounded px-4 py-3",
  15. sponsor.light ? "bg-nightshade-900" : "bg-gray-5"
  16. )}
  17. target="_blank"
  18. rel="noopener noreferrer"
  19. >
  20. <div className="max-h-[40px] max-w-[150px]">
  21. <Image
  22. className="object-contain opacity-80 grayscale transition-all group-hover:opacity-100 group-hover:grayscale-0 group-focus-visible:opacity-100 group-focus-visible:grayscale-0"
  23. alt={sponsor.name}
  24. src={sponsor.logo}
  25. width={150}
  26. height={40}
  27. layout="fixed"
  28. />
  29. </div>
  30. </a>
  31. )
  32. })}
  33. </div>
  34. )
  35. }
  36. export default SponsorLogoGroup