diff --git a/src/App.js b/src/App.js index 83c67bf..7836f25 100644 --- a/src/App.js +++ b/src/App.js @@ -30,7 +30,6 @@ import PaymentPage from "./pages/PaymentPage/PaymentPage"; import PaymentFailPage from "./pages/PaymentPage/Redirect/PaymentFailPage"; import PaymentLoadingPage from "./pages/PaymentPage/Redirect/PaymentLoadingPage"; import Splash from "./pages/Splash/Splash"; -import FestivalBoothSearch from "./pages/StoreSearch/FestivalBoothSearch"; import StoreSearchPage from "./pages/StoreSearch/StoreSearch"; function App() { // const [cookies, , removeCookies] = useCookies(); @@ -57,10 +56,8 @@ function App() { const NewPaymentPage = Auth(PaymentPage, true, 2); const NewPaymentLoadingPage = Auth(PaymentLoadingPage, true, 2); const NewPaymentFailPage = Auth(PaymentFailPage, true, 2); - const NewFestivalBoothSearch = Auth(FestivalBoothSearch, true, 2); // const NewPackagingStatusPage = Auth(PackagingStatusPage, true); - return (
@@ -121,9 +118,6 @@ function App() { /> {/* 결제 실패 리다이렉트 페이지 */} } /> - - {/* 축제 부스 검색 페이지 */} - } /> diff --git a/src/components/views/StoreList/StoreList.jsx b/src/components/views/StoreList/StoreList.jsx index bc4020c..94351a0 100644 --- a/src/components/views/StoreList/StoreList.jsx +++ b/src/components/views/StoreList/StoreList.jsx @@ -4,19 +4,11 @@ import { IMAGES } from "../../../constants/images"; import useFetchSearch from "../../../hooks/useFetchSearch"; import "./StoreList.css"; -const StoreList = ({ searchTerm = "", cafe = false, booth = false }) => { +const StoreList = ({ searchTerm = "" }) => { const navigate = useNavigate(); const stores = useFetchSearch(); let displayStores = []; - if (cafe && booth) { - displayStores = stores; - } else if (cafe) { - displayStores = stores.filter((item) => item.idx < 10); - } else if (booth) { - displayStores = stores.filter((item) => item.idx >= 10); - } - // 검색어에 따라 필터링된 목록을 반환하는 로직 const filteredStores = stores.filter((item) => { return item.name.toLowerCase().includes(searchTerm.toLowerCase()); @@ -32,11 +24,7 @@ const StoreList = ({ searchTerm = "", cafe = false, booth = false }) => { key={item.idx} className="store_list_item" onClick={() => { - if (item.idx >= 10) { - navigate(`/store?storeId=${item.idx}&inout=2`); - } else { - navigate(`/packagingStatus?storeId=${item.idx}`); - } + navigate(`/packagingStatus?storeId=${item.idx}`); }} > {
베리 PICK
- +
ReadyVery
diff --git a/src/pages/StoreSearch/FestivalBoothSearch.jsx b/src/pages/StoreSearch/FestivalBoothSearch.jsx deleted file mode 100644 index d14f1bb..0000000 --- a/src/pages/StoreSearch/FestivalBoothSearch.jsx +++ /dev/null @@ -1,56 +0,0 @@ -import React, { useEffect, useRef, useState } from "react"; -import Header from "../../components/views/Header/Header"; -import NavBar from "../../components/views/NavBar/NavBar"; -import StoreList from "../../components/views/StoreList/StoreList"; -import { IMAGES } from "../../constants/images"; -import "./StoreSearch.css"; - -function FestivalBoothSearch() { - const [searchTerm, setSearchTerm] = useState(""); - const [debouncedSearchTerm, setDebouncedSearchTerm] = useState(searchTerm); - const debounceDelay = 500; // 디바운스 지연 시간 - const inputRef = useRef(null); - - // 사용자 입력 처리 - const handleInputChange = (e) => { - setSearchTerm(e.target.value); - // console.log("검색어:", searchTerm); - }; - - // 디바운싱 구현 - useEffect(() => { - const handler = setTimeout(() => { - setDebouncedSearchTerm(searchTerm); - }, debounceDelay); - - // 컴포넌트가 unmount되거나 다음 useEffect가 실행되기 전에 타이머를 정리 - return () => { - clearTimeout(handler); - }; - }, [searchTerm, debounceDelay]); - - return ( -
-
- -
e.preventDefault()}> - search - -
- - {/* Debounced search term을 사용하여 StoreList에 prop으로 전달 */} - - - -
- ); -} - -export default FestivalBoothSearch; diff --git a/src/pages/StoreSearch/StoreSearch.jsx b/src/pages/StoreSearch/StoreSearch.jsx index aff70b4..6c9688b 100644 --- a/src/pages/StoreSearch/StoreSearch.jsx +++ b/src/pages/StoreSearch/StoreSearch.jsx @@ -46,7 +46,7 @@ function StoreSearch() { {/* Debounced search term을 사용하여 StoreList에 prop으로 전달 */} - +