From 4cafd1fd4a168aab314a3d9e123e52af320721f9 Mon Sep 17 00:00:00 2001 From: jsun969 Date: Fri, 26 Jan 2024 20:39:58 +1030 Subject: [PATCH] refactor(sponsor): use css to reverse sponsor cards --- src/app/sponsors/Sponsors.tsx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/src/app/sponsors/Sponsors.tsx b/src/app/sponsors/Sponsors.tsx index 9aea8c55..ea1be431 100644 --- a/src/app/sponsors/Sponsors.tsx +++ b/src/app/sponsors/Sponsors.tsx @@ -11,7 +11,7 @@ const SPONSOR_TYPE_COLORS = { function SponsorTypeTitle({ type }: { type: SponsorType }) { const color = SPONSOR_TYPE_COLORS[type]; return ( -
+

Our{' '} @@ -32,16 +32,13 @@ function SponsorTypeTitle({ type }: { type: SponsorType }) { style={{ backgroundColor: color }} />
-

+ ); } -type SponsorCardProps = Sponsor & { reverse?: boolean }; -function SponsorCard({ image, name, description, website, type, reverse }: SponsorCardProps) { +function SponsorCard({ image, name, description, website, type }: Sponsor) { return ( -
+
{`${name} +
{SPONSOR_TYPES.map((type) => { const sponsors = getSponsors(type); if (sponsors.length === 0) return; return ( - {sponsors.map((sponsor, i) => { - count++; - return ( - - ); - })} + {sponsors.map((sponsor, i) => ( + + ))} ); })}