search fix
parent
8358f25133
commit
20fdbd4385
|
@ -202,7 +202,8 @@ const FilterCategory = ({
|
||||||
/>
|
/>
|
||||||
</Switch>
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
<div
|
|
||||||
|
{/* <div
|
||||||
className={` p-5 border-gray-300 rounded-lg mt-3 ${
|
className={` p-5 border-gray-300 rounded-lg mt-3 ${
|
||||||
theme == 2 ? "bg-gray-100" : "bg-gray-50"
|
theme == 2 ? "bg-gray-100" : "bg-gray-50"
|
||||||
} `}
|
} `}
|
||||||
|
@ -251,19 +252,10 @@ const FilterCategory = ({
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <div className="mt-4">
|
|
||||||
<button
|
|
||||||
className="btn btn-primary w-full rounded-full text-sm "
|
|
||||||
onClick={() => handleRangePriceFilter()}
|
|
||||||
>
|
|
||||||
اعمال فیلتر
|
|
||||||
</button>
|
|
||||||
</div> */}
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ const SearchSideBar = () => {
|
||||||
if (CTX.state.closeNavbar) {
|
if (CTX.state.closeNavbar) {
|
||||||
inputRef.current.focus();
|
inputRef.current.focus();
|
||||||
}
|
}
|
||||||
|
setSearchValue("");
|
||||||
}, [CTX.state.closeNavbar]);
|
}, [CTX.state.closeNavbar]);
|
||||||
|
|
||||||
const handleInputChange = (event) => {
|
const handleInputChange = (event) => {
|
||||||
|
|
|
@ -62,7 +62,7 @@ const SurpriseSection = ({ data }) => {
|
||||||
>
|
>
|
||||||
{data?.map((e, index) => (
|
{data?.map((e, index) => (
|
||||||
<SwiperSlide key={index}>
|
<SwiperSlide key={index}>
|
||||||
<CardNormal data={e} />
|
<CardNormal data={e} priority />
|
||||||
</SwiperSlide>
|
</SwiperSlide>
|
||||||
))}
|
))}
|
||||||
</Swiper>
|
</Swiper>
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import React from "react";
|
import React, { useContext } from "react";
|
||||||
import logoBlack from "../../../public/images/logo.png";
|
import logoBlack from "../../../public/images/logo.png";
|
||||||
|
import AppContext from "@ctx/AppContext";
|
||||||
|
|
||||||
const ResultSearchBar = ({
|
const ResultSearchBar = ({
|
||||||
searchResultProductData,
|
searchResultProductData,
|
||||||
searchResultCategoryData,
|
searchResultCategoryData,
|
||||||
}) => {
|
}) => {
|
||||||
|
const CTX = useContext(AppContext);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
|
@ -37,14 +40,20 @@ const ResultSearchBar = ({
|
||||||
<Link
|
<Link
|
||||||
href={`/categories/fac3ee2d-19dd-4229-a412-28a1d09cc948/شامپو-بدن`}
|
href={`/categories/fac3ee2d-19dd-4229-a412-28a1d09cc948/شامپو-بدن`}
|
||||||
>
|
>
|
||||||
<div className="border-2 border-gray-300 py-1 px-3 rounded-full mt-1 mb-2 mx-[2px] cursor-pointer">
|
<div
|
||||||
|
className="border-2 border-gray-300 py-1 px-3 rounded-full mt-1 mb-2 mx-[2px] cursor-pointer"
|
||||||
|
onClick={() => CTX.setCloseNavbar(false)}
|
||||||
|
>
|
||||||
<p className="mb-0 text-[12px]">شامپو بدن</p>
|
<p className="mb-0 text-[12px]">شامپو بدن</p>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
href={`categories/bdf6b13c-4be5-4a93-bcdb-612440bdbd6e/کرم-مرطوب-کننده-دست-و-پا`}
|
href={`categories/bdf6b13c-4be5-4a93-bcdb-612440bdbd6e/کرم-مرطوب-کننده-دست-و-پا`}
|
||||||
>
|
>
|
||||||
<div className="border-2 border-gray-300 py-1 px-3 rounded-full mt-1 mb-2 mx-[2px] cursor-pointer">
|
<div
|
||||||
|
className="border-2 border-gray-300 py-1 px-3 rounded-full mt-1 mb-2 mx-[2px] cursor-pointer"
|
||||||
|
onClick={() => CTX.setCloseNavbar(false)}
|
||||||
|
>
|
||||||
<p className="mb-0 text-[12px]">کرم مرطوب کننده دست و پا</p>
|
<p className="mb-0 text-[12px]">کرم مرطوب کننده دست و پا</p>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -52,7 +61,10 @@ const ResultSearchBar = ({
|
||||||
<Link
|
<Link
|
||||||
href={`categories/4d3c984d-a867-495c-a0b5-302316f39fb1/شوینده-ظروف`}
|
href={`categories/4d3c984d-a867-495c-a0b5-302316f39fb1/شوینده-ظروف`}
|
||||||
>
|
>
|
||||||
<div className="border-2 border-gray-300 py-1 px-3 rounded-full mt-1 mb-2 mx-[2px] cursor-pointer">
|
<div
|
||||||
|
className="border-2 border-gray-300 py-1 px-3 rounded-full mt-1 mb-2 mx-[2px] cursor-pointer"
|
||||||
|
onClick={() => CTX.setCloseNavbar(false)}
|
||||||
|
>
|
||||||
<p className="mb-0 text-[12px]">شوینده ظروف</p>
|
<p className="mb-0 text-[12px]">شوینده ظروف</p>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -66,7 +78,10 @@ const ResultSearchBar = ({
|
||||||
key={index}
|
key={index}
|
||||||
href={`/categories/${e.id}/${e.name.split(" ").join("-")}`}
|
href={`/categories/${e.id}/${e.name.split(" ").join("-")}`}
|
||||||
>
|
>
|
||||||
<div className="flex ">
|
<div
|
||||||
|
className="flex "
|
||||||
|
onClick={() => CTX.setCloseNavbar(false)}
|
||||||
|
>
|
||||||
<div className="w-[20px] h-[40px] rounded-2xl bg-gray-200 ml-2 mt-3">
|
<div className="w-[20px] h-[40px] rounded-2xl bg-gray-200 ml-2 mt-3">
|
||||||
{" "}
|
{" "}
|
||||||
</div>
|
</div>
|
||||||
|
@ -87,7 +102,10 @@ const ResultSearchBar = ({
|
||||||
key={index}
|
key={index}
|
||||||
href={`/products/${e.id}/${e.persianName.split(" ").join("-")}`}
|
href={`/products/${e.id}/${e.persianName.split(" ").join("-")}`}
|
||||||
>
|
>
|
||||||
<div className="flex relative ">
|
<div
|
||||||
|
className="flex relative "
|
||||||
|
onClick={() => CTX.setCloseNavbar(false)}
|
||||||
|
>
|
||||||
<div className="h-fit relative">
|
<div className="h-fit relative">
|
||||||
<div className="w-[50px] h-[50px] rounded-2xl bg-gray-200 ml-2 mt-3 overflow-hidden relative ">
|
<div className="w-[50px] h-[50px] rounded-2xl bg-gray-200 ml-2 mt-3 overflow-hidden relative ">
|
||||||
{!!e.mainImage ? (
|
{!!e.mainImage ? (
|
||||||
|
|
|
@ -11,7 +11,7 @@ export async function generateMetadata({ params }) {
|
||||||
|
|
||||||
const decodedName = decodeURIComponent(params.id[1]);
|
const decodedName = decodeURIComponent(params.id[1]);
|
||||||
const imageUrl = new URL(
|
const imageUrl = new URL(
|
||||||
data?.product?.files && data?.product?.files[0].fileLocation,
|
data?.product?.files && data?.product?.files[0]?.fileLocation,
|
||||||
process.env.STORAGE_URL
|
process.env.STORAGE_URL
|
||||||
);
|
);
|
||||||
console.log("dddddd", imageUrl);
|
console.log("dddddd", imageUrl);
|
||||||
|
|
Loading…
Reference in New Issue