Skip to content

Commit

Permalink
Update collapsable rows
Browse files Browse the repository at this point in the history
  • Loading branch information
daveearley committed Nov 15, 2024
1 parent 9494c9e commit 0215634
Showing 1 changed file with 14 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {PoweredByFooter} from "../../../common/PoweredByFooter";
import {Event, Product} from "../../../../types.ts";
import {eventsClientPublic} from "../../../../api/event.client.ts";
import {promoCodeClientPublic} from "../../../../api/promo-code.client.ts";
import {IconX, IconChevronRight} from "@tabler/icons-react"
import {IconChevronRight, IconX} from "@tabler/icons-react"
import {getSessionIdentifier} from "../../../../utilites/sessionIdentifier.ts";
import {Constants} from "../../../../constants.ts";

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

const [productIsCollapsed, {toggle: collapseProduct}] = useDisclosure(product.start_collapsed);

const [productIsCollapsed, {toggle: collapseProduct}] = useDisclosure(product.start_collapsed);

return (
<div key={product.id} className={'hi-product-row'}>
Expand Down Expand Up @@ -346,26 +347,18 @@ const SelectProducts = (props: SelectProductsProps) => {
</>
)}

{(!product.is_available && product.type === 'TIERED') && (
<ProductAvailabilityMessage product={product} event={event}/>
)}
</div>
<span className={`hi-ticket-collapse-arrow`}>
<IconChevronRight className={productIsCollapsed ? "" : "open"} />
</span>
</UnstyledButton>
</div>
{(!product.is_available && product.type === 'TIERED') && (
<ProductAvailabilityMessage product={product} event={event}/>
)}

<Collapse in={!productIsCollapsed} className={'hi-product-content'}>
<div className={'hi-price-tiers-rows'}>
<TieredPricing
productIndex={productIndex}
event={event}
product={product}
form={form}
/>
</div>
<Collapse in={productIsCollapsed} className={'hi-product-content'}>
<span className={`hi-product-collapse-arrow`}>
<IconChevronRight
className={productIsCollapsed ? "" : "open"}/>
</span>
</div>
</UnstyledButton>
</div>
<Collapse transitionDuration={100} in={!productIsCollapsed} className={'hi-product-content'}>
<div className={'hi-price-tiers-rows'}>
<TieredPricing
productIndex={productIndex++}
Expand Down

0 comments on commit 0215634

Please sign in to comment.