From 73adbb76c72e560325220ff8cac0dc4b3cabb75e Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Thu, 9 Apr 2026 19:14:14 +0700 Subject: [PATCH] Refine catalog detail layout --- .../catalog/CatalogConfigurator.vue | 348 ++++++++++-------- 1 file changed, 196 insertions(+), 152 deletions(-) diff --git a/app/components/catalog/CatalogConfigurator.vue b/app/components/catalog/CatalogConfigurator.vue index 398c418..eec64dc 100644 --- a/app/components/catalog/CatalogConfigurator.vue +++ b/app/components/catalog/CatalogConfigurator.vue @@ -263,6 +263,21 @@ function visibleFields(group: ProductGroup) { } const selectedGroup = computed(() => productGroups.value.find((group) => group.key === props.productTypeSlug) ?? null); +const currentGroupIndex = computed(() => productGroups.value.findIndex((group) => group.key === props.productTypeSlug)); +const previousGroup = computed(() => { + if (currentGroupIndex.value <= 0) { + return null; + } + + return productGroups.value[currentGroupIndex.value - 1] ?? null; +}); +const nextGroup = computed(() => { + if (currentGroupIndex.value < 0 || currentGroupIndex.value >= productGroups.value.length - 1) { + return null; + } + + return productGroups.value[currentGroupIndex.value + 1] ?? null; +}); function requiredKeys(group: ProductGroup) { return visibleFields(group).map((field) => field.key); @@ -564,177 +579,206 @@ function decrementSelected(group: ProductGroup) { decrementProduct(product.id); } } + +function productDetailPath(group: ProductGroup) { + return `/products/${group.key}`; +}