Skip to content

Commit

Permalink
fix: collection
Browse files Browse the repository at this point in the history
  • Loading branch information
pratapmaharana committed Jul 11, 2023
1 parent 8be014c commit 15614c9
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
47 changes: 45 additions & 2 deletions src/lib/themes/misiki/CollectionsGeneral.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<script>
import { Deals } from '$lib/theme-config'
import { LazyImg, ProductCard } from '$lib/components'
import { onMount } from 'svelte'
import { SplideSlide } from '@splidejs/svelte-splide'
export let data = {}
let Carousel, Splide
onMount(async () => {
const SplideModule = await import('$lib/components/SplideJs.svelte')
Splide = SplideModule.default
})
</script>

{#await data.streamed.collections}
Expand All @@ -19,7 +28,41 @@ export let data = {}
{collection.name}
</h2>

<Deals deal="{collection}" />
{#if collection}
<div class="hidden px-10 items-start justify-start gap-3 sm:flex w-[99vw]">
<svelte:component
this="{Splide}"
options="{{
autoWidth: true,
gap: '24px',
height: '100%',
width: '100%',
pagination: false,
perMove: 1
}}">
{#each collection.products as p}
{#if p}
<SplideSlide>
<ProductCard product="{p}" />
</SplideSlide>
{/if}
{/each}
</svelte:component>
</div>

<div
class="flex w-[98vw] items-start justify-start gap-3 overflow-x-auto sm:hidden scrollbar-none">
<ul class="flex w-full list-none items-start gap-2">
{#each collection.products as p, px}
{#if p}
<li class="max-w-[210px]">
<ProductCard product="{p}" />
</li>
{/if}
{/each}
</ul>
</div>
{/if}
</div>
{/each}
{/if}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/themes/misiki/Deals.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { SplideSlide } from '@splidejs/svelte-splide'
export let deal
let Carousel, Splide
let Splide
$: innerWidth = 0
$: widthOfSlider = innerWidth - 410
Expand Down

1 comment on commit 15614c9

@vercel
Copy link

@vercel vercel bot commented on 15614c9 Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.