From d45ff014763f9ea5c2cc4afd30a86315d1f3db8e Mon Sep 17 00:00:00 2001 From: Jaskaran Sarkaria Date: Wed, 24 Nov 2021 20:15:55 +0000 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20only=20display=20if?= =?UTF-8?q?=20products?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 27 +++++++------ src/components/ProductView/ProductView.svelte | 40 ++++++++++--------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/public/index.html b/public/index.html index 16abb051..13dc5cb7 100644 --- a/public/index.html +++ b/public/index.html @@ -1,18 +1,19 @@ - - - - + + + Enki - - - - - - + + + + + + - - - \ No newline at end of file + + diff --git a/src/components/ProductView/ProductView.svelte b/src/components/ProductView/ProductView.svelte index 5c04a7be..3ec1b437 100644 --- a/src/components/ProductView/ProductView.svelte +++ b/src/components/ProductView/ProductView.svelte @@ -21,32 +21,34 @@ } -{#if variantArr.length} - {#each groupedVariantProducts as variants (variants)} +{#if productArr} + {#if variantArr.length} + {#each groupedVariantProducts as variants (variants)} +
+ {#each variants as variant (variant)} + + {/each} +
+ {/each} + {:else}
- {#each variants as variant (variant)} - - {/each} + {#if nonVariantArr.length} + {#each nonVariantArr as product} + + {/each} + {/if}
- {/each} -{:else} -
- {#if nonVariantArr.length} - {#each nonVariantArr as product} - - {/each} - {/if} -
+ {/if} {/if}