Skip to content

Commit 0215634

Browse files
committed
Update collapsable rows
1 parent 9494c9e commit 0215634

File tree

1 file changed

+14
-21
lines changed
  • frontend/src/components/routes/product-widget/SelectProducts

1 file changed

+14
-21
lines changed

frontend/src/components/routes/product-widget/SelectProducts/index.tsx

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {PoweredByFooter} from "../../../common/PoweredByFooter";
3333
import {Event, Product} from "../../../../types.ts";
3434
import {eventsClientPublic} from "../../../../api/event.client.ts";
3535
import {promoCodeClientPublic} from "../../../../api/promo-code.client.ts";
36-
import {IconX, IconChevronRight} from "@tabler/icons-react"
36+
import {IconChevronRight, IconX} from "@tabler/icons-react"
3737
import {getSessionIdentifier} from "../../../../utilites/sessionIdentifier.ts";
3838
import {Constants} from "../../../../constants.ts";
3939

@@ -318,7 +318,8 @@ const SelectProducts = (props: SelectProductsProps) => {
318318
.map((n) => n.toString());
319319
quantityRange.unshift("0");
320320

321-
const [productIsCollapsed, {toggle: collapseProduct}] = useDisclosure(product.start_collapsed);
321+
322+
const [productIsCollapsed, {toggle: collapseProduct}] = useDisclosure(product.start_collapsed);
322323

323324
return (
324325
<div key={product.id} className={'hi-product-row'}>
@@ -346,26 +347,18 @@ const SelectProducts = (props: SelectProductsProps) => {
346347
</>
347348
)}
348349

349-
{(!product.is_available && product.type === 'TIERED') && (
350-
<ProductAvailabilityMessage product={product} event={event}/>
351-
)}
352-
</div>
353-
<span className={`hi-ticket-collapse-arrow`}>
354-
<IconChevronRight className={productIsCollapsed ? "" : "open"} />
355-
</span>
356-
</UnstyledButton>
357-
</div>
350+
{(!product.is_available && product.type === 'TIERED') && (
351+
<ProductAvailabilityMessage product={product} event={event}/>
352+
)}
358353

359-
<Collapse in={!productIsCollapsed} className={'hi-product-content'}>
360-
<div className={'hi-price-tiers-rows'}>
361-
<TieredPricing
362-
productIndex={productIndex}
363-
event={event}
364-
product={product}
365-
form={form}
366-
/>
367-
</div>
368-
<Collapse in={productIsCollapsed} className={'hi-product-content'}>
354+
<span className={`hi-product-collapse-arrow`}>
355+
<IconChevronRight
356+
className={productIsCollapsed ? "" : "open"}/>
357+
</span>
358+
</div>
359+
</UnstyledButton>
360+
</div>
361+
<Collapse transitionDuration={100} in={!productIsCollapsed} className={'hi-product-content'}>
369362
<div className={'hi-price-tiers-rows'}>
370363
<TieredPricing
371364
productIndex={productIndex++}

0 commit comments

Comments
 (0)