x
This commit is contained in:
1 parent
4454b860c1
commit
c90799ef17
3 files changed
+12
-3
No files matched your search
@@ -43,7 +43,7 @@ export default function ProductCard({ product, enableQuickShop = false, category
|
|||||||
const { addToCart } = useCartStore();
|
const { addToCart } = useCartStore();
|
||||||
const { i18n, t } = useTranslation();
|
const { i18n, t } = useTranslation();
|
||||||
const isWished = isInWishlist(product.id);
|
const isWished = isInWishlist(product.id);
|
||||||
const [selectedVariant, setSelectedVariant] = useState(product.variants?.[0] || null);
|
const [selectedVariant, _setSelectedVariant] = useState(product.variants?.[0] || null);
|
||||||
const displayName = resolveStr(product.name, i18n.language) || (product.brand ? product.brand.name : '');
|
const displayName = resolveStr(product.name, i18n.language) || (product.brand ? product.brand.name : '');
|
||||||
const displayCategoryName = categoryNameOverride || resolveStr(product.category.name, i18n.language);
|
const displayCategoryName = categoryNameOverride || resolveStr(product.category.name, i18n.language);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export default function AccordionSection({ payload }: AccordionSectionProps) {
|
|||||||
{title}
|
{title}
|
||||||
</h2>
|
</h2>
|
||||||
)}
|
)}
|
||||||
{payload.categories.map((category, catIndex) => (
|
{(payload.categories ?? []).map((category, catIndex) => (
|
||||||
<div key={catIndex} className="mb-12 last:mb-0">
|
<div key={catIndex} className="mb-12 last:mb-0">
|
||||||
<h3 className="mb-6 flex items-center gap-3 font-serif text-2xl">
|
<h3 className="mb-6 flex items-center gap-3 font-serif text-2xl">
|
||||||
{category.icon && (
|
{category.icon && (
|
||||||
|
|||||||
+10
-1
@@ -409,10 +409,19 @@ export type ProductCarouselSectionPayload = z.infer<typeof ProductCarouselSectio
|
|||||||
|
|
||||||
// Aliases for backwards compatibility in ScentGuideSectionSchema
|
// Aliases for backwards compatibility in ScentGuideSectionSchema
|
||||||
export const HeroArticlePayloadSchema = HeroArticleSectionPayloadSchema;
|
export const HeroArticlePayloadSchema = HeroArticleSectionPayloadSchema;
|
||||||
export const RichTextPayloadSchema = RichTextSectionPayloadSchema;
|
export type HeroArticlePayload = HeroArticleSectionPayload;
|
||||||
|
|
||||||
export const ScentNotesBreakdownPayloadSchema = ScentNotesBreakdownSectionPayloadSchema;
|
export const ScentNotesBreakdownPayloadSchema = ScentNotesBreakdownSectionPayloadSchema;
|
||||||
|
export type ScentNotesBreakdownPayload = ScentNotesBreakdownSectionPayload;
|
||||||
|
|
||||||
export const QuoteCalloutPayloadSchema = QuoteCalloutSectionPayloadSchema;
|
export const QuoteCalloutPayloadSchema = QuoteCalloutSectionPayloadSchema;
|
||||||
|
export type QuoteCalloutPayload = QuoteCalloutSectionPayload;
|
||||||
|
|
||||||
export const ProductCarouselPayloadSchema = ProductCarouselSectionPayloadSchema;
|
export const ProductCarouselPayloadSchema = ProductCarouselSectionPayloadSchema;
|
||||||
|
export type ProductCarouselPayload = ProductCarouselSectionPayload;
|
||||||
|
|
||||||
|
export const RichTextPayloadSchema = RichTextSectionPayloadSchema;
|
||||||
|
export type RichTextPayload = RichTextSectionPayload;
|
||||||
|
|
||||||
export const ScentGuideSectionSchema = z.discriminatedUnion("type", [
|
export const ScentGuideSectionSchema = z.discriminatedUnion("type", [
|
||||||
z.object({
|
z.object({
|
||||||
|
|||||||
Reference in new issue
Block a user