Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

Feature: Admin ticket list improvements (#916)

Dave Earley037afe21cbd9
diff --git a/frontend/src/components/common/ProductsTable/ProductsTable.module.scss b/frontend/src/components/common/ProductsTable/ProductsTable.module.scss
index 8ef3a901c..cd2474946 100644
--- a/frontend/src/components/common/ProductsTable/ProductsTable.module.scss
+++ b/frontend/src/components/common/ProductsTable/ProductsTable.module.scss
@@ -1,26 +1,53 @@
@use "../../../styles/mixins.scss";
+// ==========================================
+// Variables & Design Tokens
+// ==========================================
+
+$card-radius: var(--hi-radius-md, 8px);
+$card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
+$card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
+$transition-fast: 150ms ease;
+$transition-base: 200ms ease;
+
+
+$color-text-primary: #1f2937;
+$color-text-secondary: #6b7280;
+$color-text-muted: #9ca3af;
+$color-border: #e5e7eb;
+$color-border-light: #f3f4f6;
+$color-success: #10b981;
+$color-money: #059669;
+
+// ==========================================
+// Category Container Styles
+// ==========================================
+
.sortableCategory {
- margin-bottom: 20px;
- transition: transform 250ms ease;
- border-radius: var(--hi-radius-sm);
+ margin-bottom: 24px;
+ transition: transform $transition-base, box-shadow $transition-base;
+ border-radius: $card-radius;
padding: var(--hi-spacing-lg);
- box-shadow: 0 3px 0 #dddddd;
- border: 1px solid #e3e3e3;
+ box-shadow: $card-shadow;
+ border: 1px solid $color-border;
background-color: #ffffff;
+
+ &:hover {
+ box-shadow: $card-shadow-hover;
+ }
}
.categoryHeader {
display: flex;
align-items: center;
justify-content: space-between;
- margin-bottom: 10px;
- gap: 10px;
+ margin-bottom: 16px;
+ gap: 12px;
}
.categoryActions {
display: flex;
- gap: 5px;
+ gap: 8px;
}
.categoryAction {
@@ -31,11 +58,19 @@
margin: 0;
display: flex;
align-items: center;
- gap: 10px;
+ gap: 12px;
+ font-weight: 600;
+ color: $color-text-primary;
}
.categoryDragHandle {
cursor: grab;
+ color: $color-text-muted;
+ transition: color $transition-fast;
+
+ &:hover {
+ color: $color-text-secondary;
+ }
&:active {
cursor: grabbing;
@@ -49,7 +84,7 @@
.dragHandleDisabled {
cursor: not-allowed;
- opacity: 0.5;
+ opacity: 0.4;
}
.categoryContent {
@@ -57,202 +92,427 @@
}
.isOver {
- background-color: #efefef;
+ background-color: $color-border-light;
}
.isDragging {
- opacity: 0.5;
+ opacity: 0.6;
z-index: 1000;
}
.dragOverlay {
.sortableCategory,
.productCard {
- transform: scale(1.05);
- box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
+ transform: scale(1.02);
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
}
.cards {
display: flex;
flex-direction: column;
+ gap: 12px;
}
+// ==========================================
+// Product Card Styles
+// ==========================================
+
.productCard {
+ position: relative;
box-sizing: border-box;
- border-radius: var(--hi-radius-sm);
- border: 1px solid #e3e3e3;
+ border-radius: $card-radius;
+ border: 1px solid $color-border;
background-color: #ffffff;
display: grid;
- padding: 20px;
- margin-bottom: 20px;
- position: relative;
- gap: 10px;
- transition: transform 250ms ease;
- grid-template-areas: "dragHanlde productInfo action";
- grid-template-columns: 40px 1fr 40px;
+ padding: 0;
+ overflow: hidden;
+ transition:
+ transform $transition-base,
+ box-shadow $transition-base,
+ border-color $transition-base;
+ grid-template-areas: "sort content action";
+ grid-template-columns: 44px 1fr auto;
+
+ &:hover {
+ box-shadow: $card-shadow-hover;
+ border-color: darken($color-border, 5%);
+
+ .actionButton {
+ background-color: $color-border-light;
+ }
+ }
@include mixins.respond-below(lg) {
grid-template-areas:
- "dragHanlde productInfo"
- "dragHanlde action";
+ "sort content"
+ "sort action";
+ grid-template-columns: 40px 1fr;
}
- .halfCircle {
- width: 20px;
- height: 10px;
- background-color: #fff;
- border-top-left-radius: 110px;
- border-top-right-radius: 110px;
- border: 1px solid #ddd;
- border-bottom: 0;
- transform: rotate(90deg);
- position: absolute;
- left: -6px;
- top: 44%;
+ @include mixins.respond-below(sm) {
+ grid-template-areas:
+ "content"
+ "action";
+ grid-template-columns: 1fr;
+
+ .sortControls {
+ display: none;
+ }
+ }
+
+ &.soldOut {
+ opacity: 0.7;
+
+ &::after {
+ content: '';
+ position: absolute;
+ inset: 0;
+ background: repeating-linear-gradient(
+ -45deg,
+ transparent,
+ transparent 10px,
+ rgba(0, 0, 0, 0.02) 10px,
+ rgba(0, 0, 0, 0.02) 20px
+ );
+ pointer-events: none;
+ }
+ }
+}
+
+
+// Sort controls
+.sortControls {
+ grid-area: sort;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 12px 0;
+ border-right: 1px solid $color-border-light;
+ background-color: #fafafa;
+}
+
+// Main content area
+.productContent {
+ grid-area: content;
+ display: flex;
+ flex-direction: column;
+ padding: 16px 20px;
+ gap: 14px;
+ min-width: 0;
+
+ @include mixins.respond-below(sm) {
+ padding: 14px 16px;
+ gap: 12px;
}
+}
+
+// Header section
+.productHeader {
+ display: flex;
+ flex-direction: column;
+ gap: 8px;
+}
+
+.badgeRow {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ flex-wrap: wrap;
+}
- .halfCircle.right {
- left: auto;
- right: -6px;
- transform: rotate(270deg);
+.typeBadges {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ flex-wrap: wrap;
+}
+
+.productTitle {
+ margin: 0;
+ font-size: 16px;
+ font-weight: 600;
+ color: $color-text-primary;
+ line-height: 1.4;
+
+ @include mixins.respond-below(sm) {
+ font-size: 15px;
}
+}
+
+.statusBadge {
+ flex-shrink: 0;
+ font-weight: 500;
+ text-transform: uppercase;
+ font-size: 10px;
+ letter-spacing: 0.5px;
+}
+
+// Details grid
+.detailsGrid {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ gap: 20px;
- .dragHandle {
- display: flex;
- justify-content: center;
- align-items: center;
- cursor: move;
- grid-area: dragHanlde;
- touch-action: none;
+ @include mixins.respond-below(lg) {
+ grid-template-columns: repeat(3, 1fr);
+ gap: 16px;
}
- .dragHandleDisabled {
- cursor: not-allowed;
- opacity: 0.5;
+ @include mixins.respond-below(md) {
+ grid-template-columns: repeat(2, 1fr);
+ gap: 14px;
}
- .productInfo {
- grid-area: productInfo;
- display: flex;
-
- .productDetails {
- display: grid;
- width: 100%;
- align-items: center;
- gap: 15px;
- flex-wrap: wrap;
- grid-template-columns: 1fr 1fr 1fr 1fr;
-
- @include mixins.respond-below(lg) {
- flex-direction: column;
- align-items: flex-start;
- grid-template-columns: 1fr 1fr;
- gap: 20px;
- }
-
- @include mixins.respond-below(sm) {
- gap: 10px;
- }
-
- @include mixins.respond-below(xs) {
- gap: 20px;
- grid-template-columns: 1fr;
- }
-
- > div {
- flex: 1;
- min-width: 125px;
-
- @include mixins.respond-below(sm) {
- min-width: 100px;
- }
- }
-
- .heading {
- text-transform: uppercase;
- color: #9ca3af;
- font-size: 0.8em;
- }
-
- .status {
- max-width: 120px;
- cursor: pointer;
- }
-
- .title {
- text-wrap: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
-
- .price {
- color: var(--hi-color-money-green);
-
- .priceAmount {
- font-weight: 600;
- text-wrap: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- }
-
- .availability {
- }
- }
+ @include mixins.respond-below(xs) {
+ grid-template-columns: 1fr;
+ gap: 12px;
}
+}
- .action {
- display: flex;
- grid-area: action;
+.detailItem {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ min-width: 0;
+}
- @include mixins.respond-below(lg) {
- margin-top: 10px;
- }
+.detailLabel {
+ font-size: 11px;
+ font-weight: 500;
+ text-transform: uppercase;
+ letter-spacing: 0.5px;
+ color: $color-text-muted;
+}
- .desktopAction {
- @include mixins.respond-below(lg) {
- display: none;
- }
- }
+// Price styling
+.priceValue {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ flex-wrap: wrap;
+}
- .mobileAction {
- display: none;
- @include mixins.respond-below(lg) {
- display: block;
- }
- }
+.priceAmount {
+ font-size: 16px;
+ font-weight: 700;
+ color: $color-money;
+ font-variant-numeric: tabular-nums;
+
+ @include mixins.respond-below(sm) {
+ font-size: 15px;
}
}
+.freePrice {
+ color: $color-success;
+}
+
+.taxIndicator {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ padding: 2px 8px;
+ background-color: #fef3c7;
+ color: #92400e;
+ border-radius: 4px;
+ font-size: 11px;
+ font-weight: 500;
+ cursor: help;
+ transition: background-color $transition-fast;
+
+ &:hover {
+ background-color: #fde68a;
+ }
+
+ svg {
+ flex-shrink: 0;
+ }
+}
+
+// Sales styling
+.salesValue {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+}
+
+.salesWithProgress {
+ display: flex;
+ flex-direction: column;
+ gap: 6px;
+}
+
+.salesCount {
+ font-size: 16px;
+ font-weight: 600;
+ color: $color-text-primary;
+ display: flex;
+ align-items: baseline;
+ gap: 4px;
+
+ @include mixins.respond-below(sm) {
+ font-size: 15px;
+ }
+}
+
+.salesTotal {
+ font-size: 13px;
+ font-weight: 400;
+ color: $color-text-muted;
+}
+
+.unlimited {
+ font-size: 12px;
+ font-weight: 400;
+ color: $color-text-muted;
+ margin-left: 4px;
+}
+
+.salesProgress {
+ max-width: 120px;
+
+ @include mixins.respond-below(sm) {
+ max-width: 100%;
+ }
+}
+
+.lowStock {
+ font-size: 11px;
+ font-weight: 500;
+ color: #ea580c;
+ display: flex;
+ align-items: center;
+ gap: 4px;
+
+ &::before {
+ content: '';
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background-color: #ea580c;
+ animation: pulse 2s infinite;
+ }
+}
+
+@keyframes pulse {
+ 0%, 100% { opacity: 1; }
+ 50% { opacity: 0.5; }
+}
+
+// Date styling
+.dateValue {
+ display: flex;
+ align-items: center;
+}
+
+.dateRange {
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+}
+
+.dateItem {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ font-size: 13px;
+ color: $color-text-secondary;
+ cursor: help;
+
+ svg {
+ color: $color-text-muted;
+ flex-shrink: 0;
+ }
+}
+
+.alwaysAvailable,
+.noEndDate {
+ font-size: 13px;
+ color: $color-text-muted;
+ font-style: italic;
+}
+
+// Action section
+.actionSection {
+ grid-area: action;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 0 12px;
+ border-left: 1px solid $color-border-light;
+ background-color: #fafafa;
+
+ @include mixins.respond-below(lg) {
+ border-left: none;
+ border-top: 1px solid $color-border-light;
+ padding: 12px 16px;
+ justify-content: flex-start;
+ }
+}
+
+.actionButton {
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ padding: 8px 12px;
+ border-radius: 6px;
+ transition: background-color $transition-fast;
+
+ @include mixins.respond-below(lg) {
+ padding: 6px 12px;
+ }
+}
+
+.actionButtonText {
+ @include mixins.respond-above(lg) {
+ display: none;
+ }
+}
+
+.actionButtonIcon {
+ @include mixins.respond-below(lg) {
+ display: none;
+ }
+}
+
+
+// ==========================================
+// Drag Preview
+// ==========================================
+
.dragPreview {
background-color: #fff;
- border: 1px solid #e3e3e3;
- border-radius: var(--hi-radius-sm);
- padding: 10px;
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
+ border: 1px solid $color-border;
+ border-radius: $card-radius;
+ padding: 12px 16px;
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
h3 {
- margin: 0 0 5px;
+ margin: 0 0 4px;
+ font-size: 14px;
+ font-weight: 600;
}
p {
margin: 0;
- color: #666;
+ color: $color-text-secondary;
+ font-size: 13px;
}
}
.moreProducts {
- background-color: #f0f0f0;
- border-radius: var(--hi-radius-sm);
- padding: 10px;
- margin-top: 10px;
- font-size: 14px;
- color: #666;
+ background-color: $color-border-light;
+ border-radius: $card-radius;
+ padding: 12px 16px;
+ margin-top: 8px;
+ font-size: 13px;
+ color: $color-text-secondary;
text-align: center;
}
.isDragging {
- opacity: 0.6;
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
+ opacity: 0.5;
+ box-shadow: $card-shadow;
}
diff --git a/frontend/src/components/common/ProductsTable/SortableProduct/index.tsx b/frontend/src/components/common/ProductsTable/SortableProduct/index.tsx
index 352bdeb5c..e7723f71c 100644
--- a/frontend/src/components/common/ProductsTable/SortableProduct/index.tsx
+++ b/frontend/src/components/common/ProductsTable/SortableProduct/index.tsx
@@ -1,10 +1,23 @@
import {useState} from 'react';
-import {IconCopyPlus, IconDotsVertical, IconEyeOff, IconPencil, IconSend, IconTrash} from "@tabler/icons-react";
+import {
+ IconCalendarEvent,
+ IconClock,
+ IconCopyPlus,
+ IconDotsVertical,
+ IconEyeOff,
+ IconLock,
+ IconPackage,
+ IconPencil,
+ IconReceipt,
+ IconSend,
+ IconTicket,
+ IconTrash,
+} from "@tabler/icons-react";
import classes from "../ProductsTable.module.scss";
import classNames from "classnames";
-import {Badge, Button, Group, Menu, Popover} from "@mantine/core";
+import {Badge, Button, Group, Menu, Progress, Tooltip} from "@mantine/core";
import Truncate from "../../Truncate";
-import {t} from "@lingui/macro";
+import {t, Trans} from "@lingui/macro";
import {relativeDate} from "../../../../utilites/dates.ts";
import {formatCurrency} from "../../../../utilites/currency.ts";
import {
@@ -62,37 +75,43 @@ export const SortableProduct = ({product, currencyCode, category, categories}: S
});
}
- const getProductStatus = (product: Product) => {
+ const getStatusInfo = (product: Product) => {
if (product.is_sold_out) {
- return t`Sold Out`;
+ return {label: t`Sold Out`, color: 'red', variant: 'filled' as const};
}
-
if (product.is_before_sale_start_date) {
- return t`On sale` + ' ' + relativeDate(product.sale_start_date as string);
+ return {label: t`Scheduled`, color: 'blue', variant: 'light' as const};
}
-
if (product.is_after_sale_end_date) {
- return t`Sale ended ` + ' ' + relativeDate(product.sale_end_date as string);
+ return {label: t`Ended`, color: 'gray', variant: 'light' as const};
}
-
if (product.is_hidden) {
- return t`Hidden from public view`;
+ return {label: t`Hidden`, color: 'gray', variant: 'outline' as const};
}
+ return product.is_available
+ ? {label: t`On Sale`, color: 'green', variant: 'light' as const}
+ : {label: t`Paused`, color: 'orange', variant: 'light' as const};
+ }
- return product.is_available ? t`On Sale` : t`Not On Sale`;
+ const getStatusTooltip = (product: Product) => {
+ if (product.is_sold_out) return t`This product is sold out`;
+ if (product.is_before_sale_start_date) return t`On sale ${relativeDate(product.sale_start_date as string)}`;
+ if (product.is_after_sale_end_date) return t`Sale ended ${relativeDate(product.sale_end_date as string)}`;
+ if (product.is_hidden) return t`Hidden from public view`;
+ return product.is_available ? t`Currently available for purchase` : t`Sales are paused`;
}
const getPriceRange = (product: Product) => {
const productPrices: ProductPrice[] = product.prices as ProductPrice[];
if (!Array.isArray(productPrices) || productPrices.length === 0) {
- return t`Price not set`;
+ return {display: t`Price not set`, isFree: false};
}
if (product.type !== ProductPriceType.Tiered) {
if (productPrices[0].price <= 0) {
- return t`Free`;
+ return {display: t`Free`, isFree: true};
}
- return formatCurrency(productPrices[0].price, currencyCode);
+ return {display: formatCurrency(productPrices[0].price, currencyCode), isFree: false};
}
const prices = productPrices.map(productPrice => productPrice.price);
@@ -100,20 +119,54 @@ export const SortableProduct = ({product, currencyCode, category, categories}: S
const maxPrice = Math.max(...prices);
if (minPrice <= 0 && maxPrice <= 0) {
- return t`Free`;
+ return {display: t`Free`, isFree: true};
}
if (minPrice === maxPrice) {
- return formatCurrency(minPrice, currencyCode);
+ return {display: formatCurrency(minPrice, currencyCode), isFree: false};
}
- return `${formatCurrency(minPrice, currencyCode)} - ${formatCurrency(maxPrice, currencyCode)}`;
+ return {
+ display: `${formatCurrency(minPrice, currencyCode)} – ${formatCurrency(maxPrice, currencyCode)}`,
+ isFree: false
+ };
+ }
+
+ const hasTaxesOrFees = () => {
+ return (product.taxes_and_fees && product.taxes_and_fees.length > 0) ||
+ (product.tax_and_fee_ids && product.tax_and_fee_ids.length > 0);
+ }
+
+ const getTaxFeeTooltip = () => {
+ if (!product.taxes_and_fees || product.taxes_and_fees.length === 0) {
+ return t`Taxes & fees applied`;
+ }
+ return product.taxes_and_fees.map(tf => tf.name).join(', ');
+ }
+
+ const getSalesProgress = () => {
+ const sold = Number(product.quantity_sold) || 0;
+ const initial = product.initial_quantity_available;
+
+ if (!initial || initial <= 0) {
+ return null; // Unlimited
+ }
+
+ const percentage = Math.min((sold / initial) * 100, 100);
+ const remaining = initial - sold;
+
+ return {
+ sold,
+ total: initial,
+ remaining,
+ percentage,
+ isLow: remaining > 0 && remaining <= 10,
+ };
}
const handleSort = (productId: IdParam, direction: 'up' | 'down') => {
if (!category?.products?.length || !product.event_id) return;
- // Find current category index in all categories
const categoryIndex = categories.findIndex(cat => cat.id === category.id);
const currentIndex = category.products.findIndex(p => p.id === productId);
@@ -121,13 +174,11 @@ export const SortableProduct = ({product, currencyCode, category, categories}: S
let updatedCategories = [...categories];
- // Handle moving to different category
if ((direction === 'up' && currentIndex === 0) ||
(direction === 'down' && currentIndex === category.products.length - 1)) {
const targetCategoryIndex = direction === 'up' ? categoryIndex - 1 : categoryIndex + 1;
- // Check if target category exists
if (targetCategoryIndex < 0 || targetCategoryIndex >= categories.length) return;
const sourceProducts = [...category.products];
@@ -136,7 +187,6 @@ export const SortableProduct = ({product, currencyCode, category, categories}: S
const targetCategory = categories[targetCategoryIndex];
const targetProducts = [...(targetCategory.products || [])];
- // Insert at end if moving up, start if moving down
const targetPosition = direction === 'up' ? targetProducts.length : 0;
targetProducts.splice(targetPosition, 0, movedProduct);
@@ -150,7 +200,6 @@ export const SortableProduct = ({product, currencyCode, category, categories}: S
return cat;
});
} else {
- // Handle moving within same category
const newIndex = direction === 'up' ? currentIndex - 1 : currentIndex + 1;
if (newIndex < 0 || newIndex >= category.products.length) return;
@@ -188,10 +237,19 @@ export const SortableProduct = ({product, currencyCode, category, categories}: S
const canMoveDown = currentIndex < currentProducts.length - 1 ||
currentCategoryIndex < categories.length - 1;
+ const isTicket = product.product_type === ProductType.Ticket;
+ const statusInfo = getStatusInfo(product);
+ const priceInfo = getPriceRange(product);
+ const salesProgress = getSalesProgress();
+
return (
<>
- <div className={classNames(classes.productCard)}>
- <div>
+ <div className={classNames(
+ classes.productCard,
+ {[classes.soldOut]: product.is_sold_out}
+ )}>
+ {/* Sort controls */}
+ <div className={classes.sortControls}>
<SortArrows
upArrowEnabled={canMoveUp}
downArrowEnabled={canMoveDown}
@@ -200,109 +258,220 @@ export const SortableProduct = ({product, currencyCode, category, categories}: S
flexDirection={'column'}
/>
</div>
- <div className={classes.productInfo}>
- <div className={classes.productDetails}>
- <div className={classes.title}>
- <div className={classes.heading}>{t`Title`}</div>
- <Truncate text={product.title} length={60}/>
- {(product.is_hidden_without_promo_code || product.is_hidden) && (
- <Popover>
- <Popover.Target>
- <IconEyeOff style={{cursor: 'pointer'}} size={14}/>
- </Popover.Target>
- <Popover.Dropdown>
- {product.is_hidden
- ? t`This product is hidden from public view`
- : t`This product is hidden unless targeted by a Promo Code`}
- </Popover.Dropdown>
- </Popover>
- )}
- </div>
- <div className={classes.description}>
- <div className={classes.heading}>{t`Status`}</div>
- <Popover>
- <Popover.Target>
- <Badge className={classes.status} color={product.is_available ? 'green' : 'orange'}
- variant="outline">
- {product.is_available ? t`On Sale` : t`Not On Sale`}
+
+ {/* Main content */}
+ <div className={classes.productContent}>
+ {/* Header row with badges */}
+ <div className={classes.productHeader}>
+ <div className={classes.badgeRow}>
+ <div className={classes.typeBadges}>
+ {isTicket ? (
+ <Badge
+ leftSection={<IconTicket size={12} />}
+ variant="light"
+ color="violet"
+ size="sm"
+ >
+ {t`Ticket`}
+ </Badge>
+ ) : (
+ <Badge
+ leftSection={<IconPackage size={12} />}
+ variant="light"
+ color="cyan"
+ size="sm"
+ >
+ {t`Product`}
+ </Badge>
+ )}
+ {product.type === ProductPriceType.Donation && (
+ <Badge
+ variant="outline"
+ color="pink"
+ size="sm"
+ >
+ {t`Donation`}
</Badge>
- </Popover.Target>
- <Popover.Dropdown>
- {getProductStatus(product)}
- </Popover.Dropdown>
- </Popover>
+ )}
+ {(product.is_hidden_without_promo_code || product.is_hidden) && (
+ <Tooltip
+ label={product.is_hidden
+ ? t`Hidden from public view`
+ : t`Only visible with promo code`}
+ withArrow
+ >
+ <Badge
+ variant="light"
+ color="gray"
+ size="sm"
+ leftSection={product.is_hidden_without_promo_code ? <IconLock size={12} /> : <IconEyeOff size={12} />}
+ >
+ {product.is_hidden_without_promo_code ? t`Promo Only` : t`Hidden`}
+ </Badge>
+ </Tooltip>
+ )}
+ </div>
+ <Tooltip label={getStatusTooltip(product)} withArrow>
+ <Badge
+ color={statusInfo.color}
+ variant={statusInfo.variant}
+ className={classes.statusBadge}
+ >
+ {statusInfo.label}
+ </Badge>
+ </Tooltip>
</div>
- <div className={classes.price}>
- <div className={classes.heading}>{t`Price`}</div>
- <div className={classes.priceAmount}>
- {getPriceRange(product)}
+ <h3 className={classes.productTitle}>
+ <Truncate text={product.title} length={80}/>
+ </h3>
+ </div>
+
+ {/* Details grid */}
+ <div className={classes.detailsGrid}>
+ {/* Price */}
+ <div className={classes.detailItem}>
+ <span className={classes.detailLabel}>{t`Price`}</span>
+ <div className={classes.priceValue}>
+ <span className={classNames(
+ classes.priceAmount,
+ {[classes.freePrice]: priceInfo.isFree}
+ )}>
+ {priceInfo.display}
+ </span>
+ {hasTaxesOrFees() && (
+ <Tooltip label={getTaxFeeTooltip()} withArrow>
+ <div className={classes.taxIndicator}>
+ <IconReceipt size={14} />
+ <span>{t`+Tax/Fees`}</span>
+ </div>
+ </Tooltip>
+ )}
</div>
</div>
- <div className={classes.availability}>
- <div className={classes.heading}>
- {product.product_type === ProductType.Ticket ? t`Attendees` : t`Quantity Sold`}
+
+ {/* Sales / Quantity */}
+ <div className={classes.detailItem}>
+ <span className={classes.detailLabel}>
+ {isTicket ? t`Attendees` : t`Sold`}
+ </span>
+ <div className={classes.salesValue}>
+ {salesProgress ? (
+ <div className={classes.salesWithProgress}>
+ <span className={classes.salesCount}>
+ {salesProgress.sold}
+ <span className={classes.salesTotal}>/ {salesProgress.total}</span>
+ </span>
+ <Progress
+ value={salesProgress.percentage}
+ size="xs"
+ color={salesProgress.percentage >= 100 ? 'red' : salesProgress.isLow ? 'orange' : 'green'}
+ className={classes.salesProgress}
+ />
+ {salesProgress.isLow && salesProgress.remaining > 0 && (
+ <span className={classes.lowStock}>
+ {t`${salesProgress.remaining} left`}
+ </span>
+ )}
+ </div>
+ ) : (
+ <span className={classes.salesCount}>
+ {Number(product.quantity_sold)}
+ <span className={classes.unlimited}>{t`Unlimited`}</span>
+ </span>
+ )}
+ </div>
+ </div>
+
+ {/* Sale period */}
+ <div className={classes.detailItem}>
+ <span className={classes.detailLabel}>{t`Sale Period`}</span>
+ <div className={classes.dateValue}>
+ {product.sale_start_date || product.sale_end_date ? (
+ <div className={classes.dateRange}>
+ {product.is_before_sale_start_date && product.sale_start_date && (
+ <Tooltip label={t`Sale starts ${relativeDate(product.sale_start_date as string)}`} withArrow>
+ <div className={classes.dateItem}>
+ <IconClock size={14} />
+ <span>{relativeDate(product.sale_start_date as string)}</span>
+ </div>
+ </Tooltip>
+ )}
+ {!product.is_before_sale_start_date && product.sale_end_date && (
+ <Tooltip label={t`Sale ends ${relativeDate(product.sale_end_date as string)}`} withArrow>
+ <div className={classes.dateItem}>
+ <IconCalendarEvent size={14} />
+ <span>{product.is_after_sale_end_date ? t`Ended` : relativeDate(product.sale_end_date as string)}</span>
+ </div>
+ </Tooltip>
+ )}
+ {!product.is_before_sale_start_date && !product.sale_end_date && (
+ <span className={classes.noEndDate}>{t`No end date`}</span>
+ )}
+ </div>
+ ) : (
+ <span className={classes.alwaysAvailable}>{t`Always available`}</span>
+ )}
</div>
- {Number(product.quantity_sold)}
</div>
</div>
</div>
- <div className={classes.action}>
+
+ {/* Actions */}
+ <div className={classes.actionSection}>
<Group wrap="nowrap" gap={0}>
- <Menu shadow="md" width={200}>
+ <Menu shadow="md" width={200} position="bottom-end">
<Menu.Target>
<div>
- <div className={classes.mobileAction}>
- <Button size="xs" variant="light">
- {t`Manage`}
- </Button>
- </div>
- <div className={classes.desktopAction}>
- <Button size="xs" variant="transparent">
- <IconDotsVertical/>
- </Button>
- </div>
+ <Button
+ size="xs"
+ variant="subtle"
+ className={classes.actionButton}
+ >
+ <span className={classes.actionButtonText}>{t`Manage`}</span>
+ <IconDotsVertical size={16} className={classes.actionButtonIcon} />
+ </Button>
</div>
</Menu.Target>
<Menu.Dropdown>
<Menu.Label>{t`Actions`}</Menu.Label>
- {product.product_type === ProductType.Ticket && (
+ {isTicket && (
<Menu.Item
onClick={() => handleModalClick(product.id, messageModal)}
- leftSection={<IconSend size={14}/>}>
+ leftSection={<IconSend size={14}/>}
+ >
{t`Message Attendees`}
</Menu.Item>
)}
<Menu.Item
onClick={() => handleModalClick(product.id, editModal)}
- leftSection={<IconPencil size={14}/>}>
- {t`Edit Product`}
+ leftSection={<IconPencil size={14}/>}
+ >
+ <Trans>Edit {isTicket ? t`Ticket` : t`Product`}</Trans>
</Menu.Item>
<Menu.Item
onClick={() => handleModalClick(product.id, duplicateModal)}
- leftSection={<IconCopyPlus size={14}/>}>
- {t`Duplicate Product`}
+ leftSection={<IconCopyPlus size={14}/>}
+ >
+ {t`Duplicate`}
</Menu.Item>
+
+ <Menu.Divider />
<Menu.Label>{t`Danger zone`}</Menu.Label>
<Menu.Item
onClick={() => handleDeleteProduct(product.id, product.event_id)}
color="red"
- leftSection={<IconTrash size={14}/>}>
- {t`Delete product`}
+ leftSection={<IconTrash size={14}/>}
+ >
+ {t`Delete`}
</Menu.Item>
</Menu.Dropdown>
</Menu>
</Group>
</div>
- {product.product_type === ProductType.Ticket && (
- <>
- <div className={classes.halfCircle}/>
- <div className={`${classes.halfCircle} ${classes.right}`}/>
- </>
- )}
-
</div>
+
{isDuplicateModalOpen &&
<DuplicateProductModal originalProductId={productId} onClose={duplicateModal.close}/>}
{isEditModalOpen && <EditProductModal productId={productId} onClose={editModal.close}/>}
diff --git a/frontend/src/components/forms/ProductForm/ProductForm.module.scss b/frontend/src/components/forms/ProductForm/ProductForm.module.scss
index 46cf44d98..01c2dd194 100644
--- a/frontend/src/components/forms/ProductForm/ProductForm.module.scss
+++ b/frontend/src/components/forms/ProductForm/ProductForm.module.scss
@@ -1,26 +1,95 @@
.priceTierCard {
position: relative;
padding: var(--hi-spacing-md) var(--hi-spacing-lg);
+ margin-bottom: var(--hi-spacing-md);
+ border-left: 3px solid var(--mantine-color-blue-5);
- .mantine-InputWrapper-root {
- margin-bottom: 0 !important;
- }
-
- .mantine-SimpleGrid-root {
- margin: 0 !important;
+ h3 {
+ margin: 0 0 var(--hi-spacing-sm) 0;
+ font-size: 0.95rem;
+ font-weight: 600;
+ color: var(--mantine-color-gray-7);
}
+}
- .removeTier {
- position: absolute;
- top: 0;
- right: 0;
- margin: 10px;
- cursor: pointer;
- }
+.removeTier {
+ position: absolute;
+ top: 0;
+ right: 0;
+ margin: 10px;
+ cursor: pointer;
- .disabled {
+ &.disabled {
svg {
color: #b4b4b4;
}
}
}
+
+.priceTiers {
+ .addTierButton {
+ margin-top: var(--hi-spacing-xs);
+ }
+}
+
+.visibilityOptions {
+ display: flex;
+ flex-direction: column;
+ gap: var(--hi-spacing-sm);
+}
+
+.additionalToggle {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: var(--hi-spacing-xs);
+ padding: var(--hi-spacing-sm) var(--hi-spacing-md);
+ margin-top: 0;
+ margin-bottom: var(--hi-spacing-xl);
+ cursor: pointer;
+ background: var(--mantine-color-gray-0);
+ border: 1px dashed var(--mantine-color-gray-3);
+ border-radius: var(--mantine-radius-md);
+ transition: background 0.15s ease, border-color 0.15s ease;
+
+ &:hover {
+ background: var(--mantine-color-gray-1);
+ border-color: var(--mantine-color-gray-4);
+ }
+
+ svg {
+ flex-shrink: 0;
+ color: var(--mantine-color-gray-5);
+ }
+
+ .toggleLabel {
+ font-size: 0.875rem;
+ font-weight: 500;
+ color: var(--mantine-color-gray-6);
+ }
+
+ .toggleDescription {
+ flex-basis: 100%;
+ font-size: 0.8rem;
+ color: var(--mantine-color-gray-5);
+ margin-left: calc(16px + var(--hi-spacing-xs));
+ margin-top: 2px;
+ }
+}
+
+.additionalOptionsContent {
+ display: flex;
+ flex-direction: column;
+ gap: var(--hi-spacing-lg);
+ margin-bottom: var(--hi-spacing-xl);
+}
+
+.fieldsetLegend {
+ display: inline-flex;
+ align-items: center;
+ gap: var(--hi-spacing-xs);
+
+ svg {
+ flex-shrink: 0;
+ }
+}
diff --git a/frontend/src/components/forms/ProductForm/index.tsx b/frontend/src/components/forms/ProductForm/index.tsx
index 73a0a677e..cadb34151 100644
--- a/frontend/src/components/forms/ProductForm/index.tsx
+++ b/frontend/src/components/forms/ProductForm/index.tsx
@@ -4,11 +4,9 @@ import {Event, Product, ProductPriceType, TaxAndFee, TaxAndFeeCalculationType, T
import {
ActionIcon,
Alert,
- Anchor,
Button,
Collapse,
ComboboxItem,
- Group,
MultiSelect,
NumberInput,
Select,
@@ -16,12 +14,19 @@ import {
TextInput
} from "@mantine/core";
import {
+ IconCalendar,
IconCash,
+ IconChevronDown,
+ IconChevronUp,
IconCoinOff,
IconCoins,
+ IconEye,
IconHeartDollar,
IconInfoCircle,
+ IconPlus,
+ IconReceipt,
IconShirt,
+ IconShoppingCart,
IconTicket,
IconTrash,
IconTrashOff,
@@ -69,7 +74,8 @@ const ProductPriceTierForm = ({form, product, event}: ProductFormProps) => {
<NumberInput decimalScale={2}
min={0}
fixedDecimalScale
- leftSection={event?.currency ? getCurrencySymbol(event.currency) : ''} {...form.getInputProps(`prices.${index}.price`)}
+ leftSection={event?.currency ? getCurrencySymbol(event.currency) : ''}
+ {...form.getInputProps(`prices.${index}.price`)}
label={t`Price`}
placeholder="19.99"/>
<TextInput
@@ -98,6 +104,7 @@ const ProductPriceTierForm = ({form, product, event}: ProductFormProps) => {
</InputGroup>
<Switch
+ mt={10}
description={t`Hiding a product will prevent users from seeing it on the event page.`}
{...form.getInputProps(`prices.${index}.is_hidden`, {type: 'checkbox'})}
label={t`Hide this tier from users`}
@@ -202,129 +209,131 @@ export const ProductForm = ({form, product}: ProductFormProps) => {
return (
<>
- <div>
- {Number(product?.quantity_sold) > 0 && (
- <Alert icon={<IconInfoCircle/>} mb={20} color={'blue'}>
- {t`You cannot change the product type as there are attendees associated with this product.`}
- </Alert>
- )}
+ {Number(product?.quantity_sold) > 0 && (
+ <Alert icon={<IconInfoCircle/>} mb={20} color={'blue'}>
+ {t`You cannot change the product type as there are attendees associated with this product.`}
+ </Alert>
+ )}
- <CustomSelect
- disabled={Number(product?.quantity_sold) > 0}
- label={t`Product Type`}
- required
- form={form}
- name={'product_type'}
- optionList={productTypeOptions}
- />
- {form.errors.product_type && (
- <Alert title={t`Product Type`} mb={20} color={'red'}>
- {form.errors.product_type}
- </Alert>
- )}
+ <CustomSelect
+ disabled={Number(product?.quantity_sold) > 0}
+ label={t`Product Type`}
+ required
+ form={form}
+ name={'product_type'}
+ optionList={productTypeOptions}
+ />
- <CustomSelect
- disabled={Number(product?.quantity_sold) > 0}
- label={t`Price Type`}
- required
- form={form}
- name={'type'}
- optionList={productPriceOptions}
- />
+ {form.errors.product_type && (
+ <Alert title={t`Product Type`} mb={20} color={'red'}>
+ {form.errors.product_type}
+ </Alert>
+ )}
- {form.errors.type && (
- <Alert title={t`Product Price Type`} mb={20} color={'red'}>
- {form.errors.type}
- </Alert>
- )}
+ <CustomSelect
+ disabled={Number(product?.quantity_sold) > 0}
+ label={t`Price Type`}
+ required
+ form={form}
+ name={'type'}
+ optionList={productPriceOptions}
+ />
- {form.values.type === ProductPriceType.Tiered && (
- <Alert title={t`What are Tiered Products?`} mb={20}>
- <Trans>
- Tiered products allow you to offer multiple price options for the same product.
- This is perfect for early bird products, or offering different price
- options for different groups of people.
- </Trans>
- </Alert>
- )}
+ {form.errors.type && (
+ <Alert title={t`Product Price Type`} mb={20} color={'red'}>
+ {form.errors.type}
+ </Alert>
+ )}
- <TextInput
- {...form.getInputProps('title')}
- label={t`Name`}
- placeholder={form.values.product_type === 'TICKET' ? t`VIP Ticket` : t`T-shirt`}
- required/>
+ {form.values.type === ProductPriceType.Tiered && (
+ <Alert variant="light" title={t`What are Tiered Products?`} mb={20} icon={<IconInfoCircle size={18}/>}>
+ <Trans>
+ Tiered products allow you to offer multiple price options for the same product.
+ This is perfect for early bird products, or offering different price
+ options for different groups of people.
+ </Trans>
+ </Alert>
+ )}
- <Editor
- label={t`Description`}
- value={form.values.description || ''}
- onChange={(value) => form.setFieldValue('description', value)}
- />
+ <TextInput
+ {...form.getInputProps('title')}
+ label={t`Name`}
+ placeholder={form.values.product_type === 'TICKET' ? t`VIP Ticket` : t`T-shirt`}
+ required
+ />
- <Select
- {...form.getInputProps('product_category_id')}
- label={<InputLabelWithHelp
- label={t`Product Category`}
- helpText={t`Categories help you organize your products. This title will be displayed on the public event page.`}
- />}
- placeholder={t`Select category...`}
- data={event?.product_categories?.map((category) => ({
- value: String(category.id),
- label: category.name,
- }))}
- />
+ <Editor
+ label={t`Description`}
+ value={form.values.description || ''}
+ onChange={(value) => form.setFieldValue('description', value)}
+ />
- {form.values.type !== ProductPriceType.Tiered && (
- <InputGroup>
- <NumberInput decimalScale={2}
- min={0}
- fixedDecimalScale
- disabled={isFreeProduct}
- leftSection={event?.currency ? getCurrencySymbol(event.currency) : ''}
- {...form.getInputProps('prices.0.price')}
- label={<InputLabelWithHelp
- label={isDonationProduct ? t`Minimum Price` : t`Price`}
- helpText={(
- <Trans>
- <p>
- Please enter the price excluding taxes and fees.
- </p>
- <p>
- Taxes and fees can be added below.
- </p>
- </Trans>
- )}
- />}
- placeholder="19.99"/>
- <NumberInput min={0}
- placeholder={t`Unlimited`}
- {...form.getInputProps('prices.0.initial_quantity_available')}
- label={<InputLabelWithHelp
- label={t`Quantity Available`}
- helpText={(
- <Trans>
- <p>
- The number of products available for this product
- </p>
- <p>
- This value can be overridden if there are <a target={'__blank'}
- href={'capacity-assignments'}>Capacity
- Limits</a> associated with this product.
- </p>
- </Trans>
- )}
- />}
- />
- </InputGroup>
- )}
- </div>
+ <Select
+ {...form.getInputProps('product_category_id')}
+ label={<InputLabelWithHelp
+ label={t`Product Category`}
+ helpText={t`Categories help you organize your products. This title will be displayed on the public event page.`}
+ />}
+ placeholder={t`Select category...`}
+ data={event?.product_categories?.map((category) => ({
+ value: String(category.id),
+ label: category.name,
+ }))}
+ />
+
+ {form.values.type !== ProductPriceType.Tiered && (
+ <InputGroup>
+ <NumberInput decimalScale={2}
+ min={0}
+ fixedDecimalScale
+ disabled={isFreeProduct}
+ leftSection={event?.currency ? getCurrencySymbol(event.currency) : ''}
+ {...form.getInputProps('prices.0.price')}
+ label={<InputLabelWithHelp
+ label={isDonationProduct ? t`Minimum Price` : t`Price`}
+ helpText={(
+ <Trans>
+ <p>
+ Please enter the price excluding taxes and fees.
+ </p>
+ <p>
+ Taxes and fees can be added below.
+ </p>
+ </Trans>
+ )}
+ />}
+ placeholder="19.99"/>
+ <NumberInput min={0}
+ placeholder={t`Unlimited`}
+ {...form.getInputProps('prices.0.initial_quantity_available')}
+ label={<InputLabelWithHelp
+ label={t`Quantity Available`}
+ helpText={(
+ <Trans>
+ <p>
+ The number of products available for this product
+ </p>
+ <p>
+ This value can be overridden if there are <a target={'__blank'}
+ href={'capacity-assignments'}>Capacity
+ Limits</a> associated with this product.
+ </p>
+ </Trans>
+ )}
+ />}
+ />
+ </InputGroup>
+ )}
{form.values.type === ProductPriceType.Tiered && (
- <Fieldset legend={t`Price tiers`} mt={20} mb={20}>
- <ProductPriceTierForm product={product} form={form} event={event}/>
- <Group>
+ <Fieldset legend={t`Price Tiers`} mt={20} mb={20}>
+ <div className={classes.priceTiers}>
+ <ProductPriceTierForm product={product} form={form} event={event}/>
<Button
+ className={classes.addTierButton}
size={'xs'}
variant={'light'}
+ leftSection={<IconPlus size={14}/>}
onClick={() =>
form.insertListItem('prices', {
price: 0,
@@ -336,87 +345,121 @@ export const ProductForm = ({form, product}: ProductFormProps) => {
>
{t`Add tier`}
</Button>
- </Group>
+ </div>
</Fieldset>
)}
- <Anchor display={'block'} ml={5} mb={20} variant={'subtle'} onClick={toggle}>
- {opened ? t`Hide` : t`Show`} {t`Additional Options`}
- </Anchor>
+ <div
+ className={classes.additionalToggle}
+ onClick={toggle}
+ role="button"
+ tabIndex={0}
+ onKeyDown={(e) => e.key === 'Enter' && toggle()}
+ >
+ {opened ? <IconChevronUp size={16}/> : <IconChevronDown size={16}/>}
+ <span className={classes.toggleLabel}>{opened ? t`Hide Additional Options` : t`Show Additional Options`}</span>
+ {!opened && <span className={classes.toggleDescription}>{t`Taxes, fees, sale period, order limits, and visibility settings`}</span>}
+ </div>
<Collapse in={opened}>
- <Fieldset legend={t`Additional Options`} mb={20}>
- <MultiSelect
- {...form.getInputProps('tax_and_fee_ids')}
- label={t`Taxes and Fees`}
- placeholder={t`Select...`}
- description={(
- <span>
- {t`The taxes and fees to apply to this product. You can create new taxes and fees on the`}{' '}
- <NavLink
- target={'_blank'}
- to={'/account/taxes-and-fees'}>{t`Taxes and Fees`}</NavLink> {t`page.`}
- {' '}
- </span>
+ <div className={classes.additionalOptionsContent}>
+ <Fieldset legend={
+ <span className={classes.fieldsetLegend}>
+ <IconReceipt size={16}/>
+ {t`Taxes and Fees`}
+ </span>
+ }>
+ <MultiSelect
+ {...form.getInputProps('tax_and_fee_ids')}
+ label={t`Taxes and Fees`}
+ placeholder={t`Select...`}
+ description={(
+ <span>
+ {t`The taxes and fees to apply to this product. You can create new taxes and fees on the`}{' '}
+ <NavLink
+ target={'_blank'}
+ to={'/account/taxes-and-fees'}>{t`Taxes and Fees`}</NavLink> {t`page.`}
+ </span>
+ )}
+ data={[{
+ group: t`Taxes`,
+ items: taxAndFeeOptions(TaxAndFeeType.Tax),
+ }, {
+ group: t`Fees`,
+ items: taxAndFeeOptions(TaxAndFeeType.Fee),
+ }]}
+ />
+
+ {(form.values.type === ProductPriceType.Free && !!form.values.tax_and_fee_ids?.length) && (
+ <Alert mt={15}>
+ <p>
+ {t`You have taxes and fees added to a Free Product. Would you like to remove them?`}
+ </p>
+ <Button onClick={removeTaxesAndFees} size={'xs'}>{t`Yes, remove them`}</Button>
+ </Alert>
)}
- data={[{
- group: t`Taxes`,
- items: taxAndFeeOptions(TaxAndFeeType.Tax),
- }, {
- group: t`Fees`,
- items: taxAndFeeOptions(TaxAndFeeType.Fee),
- }]}
- />
+ </Fieldset>
- {(form.values.type === ProductPriceType.Free && !!form.values.tax_and_fee_ids?.length) && (
- <Alert mb={20}>
- <p>
- {t`You have taxes and fees added to a Free Product. Would you like to remove them?`}
- </p>
- <Button onClick={removeTaxesAndFees} size={'xs'}>{t`Yes, remove them`}</Button>
- </Alert>
- )}
+ <Fieldset legend={
+ <span className={classes.fieldsetLegend}>
+ <IconShoppingCart size={16}/>
+ {t`Order Limits`}
+ </span>
+ }>
+ <InputGroup>
+ <NumberInput {...form.getInputProps('min_per_order')} label={t`Minimum Per Order`}
+ placeholder="1"/>
+ <NumberInput {...form.getInputProps('max_per_order')} label={t`Maximum Per Order`}
+ placeholder="10"/>
+ </InputGroup>
+ </Fieldset>
- <InputGroup>
- <NumberInput {...form.getInputProps('min_per_order')} label={t`Minimum Per Order`}
- placeholder="5"/>
- <NumberInput {...form.getInputProps('max_per_order')} label={t`Maximum Per Order`}
- placeholder="5"/>
- </InputGroup>
+ <Fieldset legend={
+ <span className={classes.fieldsetLegend}>
+ <IconCalendar size={16}/>
+ {t`Sale Period`}
+ </span>
+ }>
+ <InputGroup>
+ <TextInput type={'datetime-local'} {...form.getInputProps('sale_start_date')}
+ label={t`Sale Start Date`}/>
+ <TextInput type={'datetime-local'} {...form.getInputProps('sale_end_date')}
+ label={t`Sale End Date`}/>
+ </InputGroup>
+ </Fieldset>
- <InputGroup>
- <TextInput type={'datetime-local'} {...form.getInputProps('sale_start_date')}
- label={t`Sale Start Date`}/>
- <TextInput type={'datetime-local'} {...form.getInputProps('sale_end_date')}
- label={t`Sale End Date`}/>
- </InputGroup>
- <h3>
- {t`Visibility`}
- </h3>
- <Switch mt={15} {...form.getInputProps('hide_before_sale_start_date', {type: 'checkbox'})}
- label={t`Hide product before sale start date`}/>
- <Switch mt={20} {...form.getInputProps('hide_after_sale_end_date', {type: 'checkbox'})}
- label={t`Hide product after sale end date`}/>
- <Switch mt={20} {...form.getInputProps('start_collapsed', {type: 'checkbox'})}
- label={t`Collapse this product when the event page is initially loaded`}/>
- <Switch mt={20} {...form.getInputProps('show_quantity_remaining', {type: 'checkbox'})}
- label={t`Show available product quantity`}/>
- <Switch mt={20} {...form.getInputProps('hide_when_sold_out', {type: 'checkbox'})}
- label={t`Hide product when sold out`}/>
- <Switch
- description={<>{t`You can create a promo code which targets this product on the`} <NavLink
- target={'_blank'}
- to={'../promo-codes'}>{t`Promo Code page`}</NavLink></>}
- mt={20}
- {...form.getInputProps('is_hidden_without_promo_code', {type: 'checkbox'})}
- label={t`Hide product unless user has applicable promo code`}
- />
- <Switch
- description={t`This overrides all visibility settings and will hide the product from all customers.`}
- {...form.getInputProps(`is_hidden`, {type: 'checkbox'})}
- label={t`Hide this product from customers`}
- />
- </Fieldset>
+ <Fieldset legend={
+ <span className={classes.fieldsetLegend}>
+ <IconEye size={16}/>
+ {t`Visibility`}
+ </span>
+ }>
+ <div className={classes.visibilityOptions}>
+ <Switch {...form.getInputProps('hide_before_sale_start_date', {type: 'checkbox'})}
+ label={t`Hide product before sale start date`}/>
+ <Switch {...form.getInputProps('hide_after_sale_end_date', {type: 'checkbox'})}
+ label={t`Hide product after sale end date`}/>
+ <Switch {...form.getInputProps('start_collapsed', {type: 'checkbox'})}
+ label={t`Collapse this product when the event page is initially loaded`}/>
+ <Switch {...form.getInputProps('show_quantity_remaining', {type: 'checkbox'})}
+ label={t`Show available product quantity`}/>
+ <Switch {...form.getInputProps('hide_when_sold_out', {type: 'checkbox'})}
+ label={t`Hide product when sold out`}/>
+ <Switch
+ description={<>{t`You can create a promo code which targets this product on the`} <NavLink
+ target={'_blank'}
+ to={'../promo-codes'}>{t`Promo Code page`}</NavLink></>}
+ {...form.getInputProps('is_hidden_without_promo_code', {type: 'checkbox'})}
+ label={t`Hide product unless user has applicable promo code`}
+ />
+ <Switch
+ description={t`This overrides all visibility settings and will hide the product from all customers.`}
+ {...form.getInputProps(`is_hidden`, {type: 'checkbox'})}
+ label={t`Hide this product from customers`}
+ />
+ </div>
+ </Fieldset>
+ </div>
</Collapse>
</>
);