This commit is contained in:
2025-11-03 13:35:27 +05:45
parent 8dc84a6119
commit ecfd29ff2e
3 changed files with 84 additions and 45 deletions

View File

@@ -66,12 +66,16 @@
</a> </a>
</div> </div>
<div class="flex w-full items-center gap-2 max-lg:order-3 max-lg:w-full"> <div class="flex w-full items-center gap-2 max-lg:order-3 max-lg:w-full">
<Sheet.Root> <Sheet.Root {open}>
<Sheet.Trigger> <Sheet.Trigger
onclick={() => {
open = true;
}}
>
<!-- <SlidersHorizontal class="md:hidden" strokeWidth={1.8} size={20} /> --> <!-- <SlidersHorizontal class="md:hidden" strokeWidth={1.8} size={20} /> -->
<p class="text-sm font-medium md:hidden">Categories</p> <p class="text-sm font-medium md:hidden">Categories</p>
</Sheet.Trigger> </Sheet.Trigger>
<Sheet.Content side="left" class="flex w-full flex-col gap-8 sm:w-full"> <Sheet.Content side="left" class="flex w-full flex-col gap-8 px-4 sm:w-full">
<Sheet.Header class="text-start"> <Sheet.Header class="text-start">
<Sheet.Title>Categories</Sheet.Title> <Sheet.Title>Categories</Sheet.Title>
</Sheet.Header> </Sheet.Header>
@@ -83,7 +87,13 @@
<!-- {#await category then categoryItem} --> <!-- {#await category then categoryItem} -->
{#each category?.categories as item} {#each category?.categories as item}
{#if item?.status !== 'draft'} {#if item?.status !== 'draft'}
<a href="/category/{item?.id}/{item?.slug}" class="text-nowrap">{item?.title}</a> <a
href="/category/{item?.id}/{item?.slug}"
class="text-nowrap"
onclick={() => {
open = false;
}}>{item?.title}</a
>
{/if} {/if}
{/each} {/each}
<!-- {/await} --> <!-- {/await} -->

View File

@@ -48,10 +48,15 @@
]; ];
</script> </script>
<div class="mx-auto my-12 flex w-full max-w-screen-2xl flex-col gap-6 px-12 py-4"> <div
<div> class="mx-auto my-12 flex w-full max-w-screen-2xl flex-col gap-6 px-12 py-4 max-sm:my-4 max-sm:h-auto max-sm:max-w-full max-sm:flex-wrap max-sm:px-6"
<Tabs.Root value={brands[0]?.name.slice(0, 1).toLowerCase()} class="flex flex-col gap-12"> >
<Tabs.List class="flex-wrap gap-2 bg-transparent"> <Tabs.Root
value={brands[0]?.name.slice(0, 1).toLowerCase()}
class="gap-12"
orientation={'vertical'}
>
<Tabs.List class="flex !h-auto w-full flex-wrap gap-2 bg-transparent">
{#each alphabets as letter} {#each alphabets as letter}
<!-- {#each brands as brand} --> <!-- {#each brands as brand} -->
<!-- {#if letter === brand?.name.slice(0, 1).toLowerCase()} --> <!-- {#if letter === brand?.name.slice(0, 1).toLowerCase()} -->
@@ -89,4 +94,3 @@
{/each} {/each}
</Tabs.Root> </Tabs.Root>
</div> </div>
</div>

View File

@@ -218,7 +218,32 @@
{#await data?.productCategory} {#await data?.productCategory}
<div></div> <div></div>
{:then category} {:then category}
{#if category?.attributes.length > 0} {#each originalFilters as attribute}
<div class="flex flex-col gap-2.5">
<Sheet.Title class="text-start font-normal">{attribute.title}</Sheet.Title>
<!-- <p class="text-sm font-semibold">{attribute.title}</p> -->
<ul class="flex flex-col gap-1.5">
{#each attribute.values as value, index}
<li class="flex items-center gap-2">
<Checkbox
id={`${attribute.title}-${index}`}
checked={isChecked('attributes[]', value.id)}
onCheckedChange={(e) => handleCheckboxChange('attributes[]', value.id, e)}
/>
<!-- disabled={!currentFilters.some(
(f) =>
f.title === attribute.title && f.values.some((v) => v.value === value.id)
)} -->
<p class="text-sm">{value.value}</p>
{#if !currentFilters.some((f) => f.title === attribute.title && f.values.some((v) => v.value === value.value))}
<span class="text-xs text-gray-400">(0)</span>
{/if}
</li>
{/each}
</ul>
</div>
{/each}
<!-- {#if category?.attributes.length > 0}
{#each category?.attributes as attribute} {#each category?.attributes as attribute}
<Sheet.Title class="text-start font-normal">{attribute.title}</Sheet.Title> <Sheet.Title class="text-start font-normal">{attribute.title}</Sheet.Title>
<Sheet.Description> <Sheet.Description>
@@ -232,7 +257,7 @@
</ul> </ul>
</Sheet.Description> </Sheet.Description>
{/each} {/each}
{/if} {/if} -->
{/await} {/await}
</Sheet.Header> </Sheet.Header>
</Sheet.Content> </Sheet.Content>