Skip to content

Commit

Permalink
refactor: 💡 only display if products
Browse files Browse the repository at this point in the history
  • Loading branch information
jaskaransarkaria committed Nov 24, 2021
1 parent 3452f94 commit d45ff01
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
27 changes: 14 additions & 13 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<meta name="description" content="Enki Jewellery & Craft Gallery shop in Kings Heath, Birmingham, UK">
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta
name="description"
content="Enki Jewellery & Craft Gallery shop in Kings Heath, Birmingham, UK"
/>
<title>Enki</title>
<link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/global.css'>
<link rel='stylesheet' href='/build/bundle-1637781279741.css'>
<script defer src='/build/bundle-1637781279741.js'></script>

<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="stylesheet" href="/global.css" />
<link rel="stylesheet" href="/build/bundle-1637781279741.css" />

<script defer src="/build/bundle-1637781279741.js"></script>
</head>
<body>
</body>
</html>
<body></body>
</html>
40 changes: 21 additions & 19 deletions src/components/ProductView/ProductView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,34 @@
}
</script>

{#if variantArr.length}
{#each groupedVariantProducts as variants (variants)}
{#if productArr}
{#if variantArr.length}
{#each groupedVariantProducts as variants (variants)}
<div
in:fade={{ delay: 500 }}
class={showDetailedView
? 'detailed-products-container'
: 'products-container'}
>
{#each variants as variant (variant)}
<SingleProduct product={variant} />
{/each}
</div>
{/each}
{:else}
<div
in:fade={{ delay: 500 }}
class={showDetailedView
? 'detailed-products-container'
: 'products-container'}
>
{#each variants as variant (variant)}
<SingleProduct product={variant} />
{/each}
{#if nonVariantArr.length}
{#each nonVariantArr as product}
<SingleProduct {product} {showDetailedView} />
{/each}
{/if}
</div>
{/each}
{:else}
<div
in:fade={{ delay: 500 }}
class={showDetailedView
? 'detailed-products-container'
: 'products-container'}
>
{#if nonVariantArr.length}
{#each nonVariantArr as product}
<SingleProduct {product} {showDetailedView} />
{/each}
{/if}
</div>
{/if}
{/if}

<style>
Expand Down

0 comments on commit d45ff01

Please sign in to comment.