Skip to content

Commit 2431383

Browse files
committed
Support multiple tshirts products
1 parent c28960a commit 2431383

File tree

1 file changed

+13
-9
lines changed
  • frontend/src/components/products-list

1 file changed

+13
-9
lines changed

frontend/src/components/products-list/index.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const ProductsList = ({
4646
const membership = products.filter(
4747
(product) => product.type === TicketType.Association,
4848
)[0];
49-
const tshirt = products.filter((product) => product.category === "Gadget")[0];
49+
const tshirts = products.filter((product) => product.category === "Gadget");
5050
const socialEvents = products.filter(
5151
(product) => product.type === TicketType.SocialEvent,
5252
);
@@ -90,20 +90,24 @@ export const ProductsList = ({
9090
</>
9191
)}
9292

93-
{visibleCategories.includes(CheckoutCategory.Gadgets) && tshirt && (
93+
{visibleCategories.includes(CheckoutCategory.Gadgets) && tshirts && (
9494
<>
9595
{showHeadings && (
9696
<GroupHeading>
9797
<FormattedMessage id="tickets.productsList.tshirtTitle" />
9898
</GroupHeading>
9999
)}
100-
<TicketRow
101-
key={tshirt.id}
102-
icon="tshirt"
103-
iconBackground="yellow"
104-
ticket={tshirt}
105-
/>
106-
<Spacer size="small" />
100+
{tshirts.map((tshirt) => (
101+
<Fragment key={tshirt.id}>
102+
<TicketRow
103+
key={tshirt.id}
104+
icon="tshirt"
105+
iconBackground="yellow"
106+
ticket={tshirt}
107+
/>
108+
<Spacer size="small" />
109+
</Fragment>
110+
))}
107111
</>
108112
)}
109113

0 commit comments

Comments
 (0)