|
|
@@ -6,7 +6,7 @@ import Grid from "@/components/theme/ui/grid/Grid";
|
|
|
import HotSearch from "@/app/(public)/search/_components/HotSearch"
|
|
|
import { useMediaQuery } from "@utils/hooks/useMediaQueryHook";
|
|
|
import Link from "next/link";
|
|
|
-import { usePathname } from "next/navigation";
|
|
|
+// import { usePathname } from "next/navigation";
|
|
|
// const ProductGridItems = dynamicImport(
|
|
|
// () => import("@/components/catalog/product/ProductGridItems"),
|
|
|
// );
|
|
|
@@ -25,13 +25,13 @@ export default function SearchPop({ open, onClose }: SearchPopProps) {
|
|
|
|
|
|
const products = data?.edges?.map((e) => e.node) || [];
|
|
|
const isDesktop = useMediaQuery("(min-width: 1024px)");
|
|
|
- const pathname = usePathname();
|
|
|
- useEffect(() => {
|
|
|
- // 打开状态下,路由变化就关闭弹窗
|
|
|
- if (open) {
|
|
|
- handleClose();
|
|
|
- }
|
|
|
- }, [pathname]);
|
|
|
+ // const pathname = usePathname();
|
|
|
+ // useEffect(() => {
|
|
|
+ // // 打开状态下,路由变化就关闭弹窗
|
|
|
+ // if (open) {
|
|
|
+ // handleClose();
|
|
|
+ // }
|
|
|
+ // }, [pathname]);
|
|
|
// 执行搜索接口
|
|
|
const triggerSearch = async (searchWord: string) => {
|
|
|
if (!searchWord.trim()) return;
|