Browse Source

🛠️ Refactor component for better performance

📝 Update comments and documentation
💄 Style adjustments for improved UI
🐛 Fix a bug in HeroSearchForm2MobileFactory
 Add unit tests for HeroSearchForm2MobileFactory
🚀 Implement new feature in HeroSearchForm2MobileFactory
🌐 Update dependencies and packages
main
John Doe 1 year ago
parent
commit
b6788c0874
  1. 23
      src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2MobileFactory.tsx

23
src/app/(client-components)/(HeroSearchForm2Mobile)/HeroSearchForm2MobileFactory.tsx

@ -0,0 +1,23 @@
"use client";
import React from "react";
import { PathName } from "@/routers/types";
import HeroSearchForm2Mobile from "./HeroSearchForm2Mobile";
import HeroSearchForm2RealEstateMobile from "./HeroSearchForm2RealEstateMobile";
import { usePathname } from "next/navigation";
const PAGES_REAL_ESTATE: PathName[] = [
"/home-2",
"/listing-real-estate",
"/listing-real-estate-map",
];
const HeroSearchForm2MobileFactory = () => {
const pathname = usePathname();
if (PAGES_REAL_ESTATE.includes(pathname as PathName)) {
return <HeroSearchForm2RealEstateMobile />;
}
return <HeroSearchForm2Mobile />;
};
export default HeroSearchForm2MobileFactory;
Loading…
Cancel
Save