category page
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import Input from "@/app/components/Input";
|
|
||||||
import { cn } from "@/app/lib/cn";
|
import { cn } from "@/app/lib/cn";
|
||||||
import { AddSquare, MinusSquare } from "iconsax-reactjs";
|
import { AddSquare, MinusSquare } from "iconsax-reactjs";
|
||||||
import { useState, type FC } from "react";
|
import { useState, type FC } from "react";
|
||||||
@@ -19,9 +18,7 @@ const CategoryFilters: FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full shrink-0 space-y-3 lg:w-70 xl:w-75">
|
<div className="w-full shrink-0 lg:w-70 xl:w-75">
|
||||||
<Input variant="search" placeholder="جستجو..." className="rounded-xl border-[#E9EFF4]" />
|
|
||||||
|
|
||||||
<aside className="rounded-2xl bg-white p-4 shadow-[0_0_6px_rgba(50,103,137,0.18)] sm:rounded-3xl sm:p-5">
|
<aside className="rounded-2xl bg-white p-4 shadow-[0_0_6px_rgba(50,103,137,0.18)] sm:rounded-3xl sm:p-5">
|
||||||
<h2 className="mb-4 text-center text-lg font-bold text-[#0A1B2C]">فیلترها</h2>
|
<h2 className="mb-4 text-center text-lg font-bold text-[#0A1B2C]">فیلترها</h2>
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,17 @@
|
|||||||
import { Sort } from "iconsax-reactjs";
|
import Input from "@/app/components/Input";
|
||||||
|
import Select from "@/app/components/Select";
|
||||||
import { type FC } from "react";
|
import { type FC } from "react";
|
||||||
import { SORT_OPTIONS } from "../constants";
|
import { SORT_OPTIONS } from "../constants";
|
||||||
|
|
||||||
const CategoryToolbar: FC = () => {
|
const CategoryToolbar: FC = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-start">
|
<div className="flex items-center gap-4">
|
||||||
<div className="relative w-37">
|
<div className="max-w-50">
|
||||||
<select defaultValue="bestseller" aria-label="مرتبسازی" className="h-10 w-full appearance-none rounded-xl border border-[#E9EFF4] bg-white px-3 pr-10 text-right text-sm text-[#5B6A74]">
|
<Input variant="search" placeholder="جستجو..." className="rounded-xl border-[#E9EFF4]" />
|
||||||
{SORT_OPTIONS.map((option) => (
|
</div>
|
||||||
<option key={option.value} value={option.value}>
|
|
||||||
{option.label}
|
<div className="max-w-50">
|
||||||
</option>
|
<Select options={SORT_OPTIONS} placeholder="مرتبسازی" className="min-w-50 rounded-xl border-[#E9EFF4]" />
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
<Sort aria-hidden className="pointer-events-none absolute top-1/2 right-2.5 -translate-y-1/2 text-primary" color="currentColor" size={18} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,12 +9,14 @@ const CategoryDetailPage = () => {
|
|||||||
<div>
|
<div>
|
||||||
<CategoryHero />
|
<CategoryHero />
|
||||||
|
|
||||||
<div className="px-4 mt-10 sm:px-8 lg:px-30 pt-8 sm:pt-10 pb-8 sm:pb-10">
|
<div className="space-y-4 px-4 mt-10 sm:space-y-5 sm:px-8 lg:px-30 pt-8 sm:pt-10 pb-8 sm:pb-10">
|
||||||
|
<div className="lg:grid lg:gap-x-6">
|
||||||
|
<CategoryToolbar />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="flex flex-col gap-4 lg:flex-row lg:items-start lg:gap-6">
|
<div className="flex flex-col gap-4 lg:flex-row lg:items-start lg:gap-6">
|
||||||
<CategoryFilters />
|
<CategoryFilters />
|
||||||
|
<div className="min-w-0 flex-1">
|
||||||
<div className="min-w-0 w-full flex-1 space-y-4 sm:space-y-5">
|
|
||||||
<CategoryToolbar />
|
|
||||||
<CategoryProducts />
|
<CategoryProducts />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export type SelectOption = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
options?: SelectOption[];
|
options?: readonly SelectOption[];
|
||||||
className?: string;
|
className?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
} & Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "placeholder">;
|
} & Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "placeholder">;
|
||||||
|
|||||||
Reference in New Issue
Block a user