Skip to content

Commit

Permalink
Merge branch 'test' of https://github.com/hhbb0081/readyFront into test
Browse files Browse the repository at this point in the history
  • Loading branch information
hhbb0081 committed May 27, 2024
2 parents 98fa1a1 + 1007e89 commit 3c65b39
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 94 deletions.
Binary file removed public/images/test/test.png
Binary file not shown.
Binary file removed public/images/test2/test.png
Binary file not shown.
Binary file removed public/images/test3/test.png
Binary file not shown.
6 changes: 0 additions & 6 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 (
<div className="App">
<RecoilRoot>
Expand Down Expand Up @@ -121,9 +118,6 @@ function App() {
/>
{/* 결제 실패 리다이렉트 페이지 */}
<Route path="/payment/fail" element={<NewPaymentFailPage />} />

{/* 축제 부스 검색 페이지 */}
<Route path="/booth" element={<NewFestivalBoothSearch />} />
</Routes>
</Suspense>
</RecoilRoot>
Expand Down
24 changes: 13 additions & 11 deletions src/components/views/Home/Banner/Banner.jsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import Slider from "react-slick";
import "slick-carousel/slick/slick-theme.css";
import "slick-carousel/slick/slick.css";
import { IMAGES } from "../../../../constants/images";
import "./Banner.css";

const Banner = () => {
const navigate = useNavigate();
const eventBanners = [
// { bannerImg: "https://readyvery.com/statics/images/event/ic_home_event1.png" },
// { bannerImg: "https://readyvery.com/statics/images/event/ic_home_event2.png" },
// { bannerImg: "https://readyvery.com/statics/images/event/ic_home_event3.png" },
{ bannerImg: IMAGES.banner_img },
{ bannerImg: IMAGES.banner2_img },
{
bannerImg:
"https://readyvery.com/statics/images/event/ic_home_event1.png",
},
{
bannerImg:
"https://readyvery.com/statics/images/event/ic_home_event2.png",
},
{
bannerImg:
"https://readyvery.com/statics/images/event/ic_home_event3.png",
},
];

const [currentIndex, setCurrentIndex] = useState(0);
Expand All @@ -31,14 +35,12 @@ const Banner = () => {
return (
<div className="home_event">
<div className="home_event_slider_benner_wrapper">
<Slider {...settings} >
<Slider {...settings}>
{eventBanners.map((item) => {
return (
<div
className="home_event_slider_benner"
key={item}
// onClick={() => navigate(`/search`)}
onClick={() => navigate(`/booth`)}
>
<img src={item.bannerImg} alt={`Banner ${item}`} />
</div>
Expand Down
18 changes: 3 additions & 15 deletions src/components/views/StoreList/StoreList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,18 @@ 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());
});

// 검색어가 있을 경우 filteredStores를 사용하고, 없을 경우 기존 stores를 사용
displayStores = searchTerm ? filteredStores : displayStores;
displayStores = searchTerm ? filteredStores : stores;

return (
<div className="store_list">
Expand All @@ -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}`);
}}
>
<img
Expand Down
4 changes: 0 additions & 4 deletions src/constants/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,4 @@ export const IMAGES = {
check_red: require("../assets/images/check_red.png"),
check_x_red: require("../assets/images/check_x_red.png"),
find_logo: require("../assets/images/ic_find_logo.png"),

// 축제 배너 이미지 하드
banner_img: require("../assets/images/banner_readybarry.png"),
banner2_img: require("../assets/images/banner2_readybarry.png"),
};
2 changes: 1 addition & 1 deletion src/pages/HomePage/Homepage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const HomePage = () => {
<Banner />

<div className="home_berry_pick">베리 PICK</div>
<StoreList cafe={true} />
<StoreList />

<div className="home_business_info">
<div className="home_business_info_name">ReadyVery</div>
Expand Down
56 changes: 0 additions & 56 deletions src/pages/StoreSearch/FestivalBoothSearch.jsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/StoreSearch/StoreSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function StoreSearch() {
</form>

{/* Debounced search term을 사용하여 StoreList에 prop으로 전달 */}
<StoreList searchTerm={debouncedSearchTerm} cafe={true} booth={true} />
<StoreList searchTerm={debouncedSearchTerm} />

<NavBar />
</div>
Expand Down

0 comments on commit 3c65b39

Please sign in to comment.