Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Banner onClick 삭제 #237

Merged
merged 2 commits into from
Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/components/views/Home/Banner/Banner.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
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";
Expand All @@ -9,7 +8,6 @@ import "./Banner.css";
const Banner = () => {
const eventBanners = useFetchEventBanners(); //이벤트 배너를 서버에서 받아옴
const [currentIndex, setCurrentIndex] = useState(0);
const navigate = useNavigate();

const settings = {
slidesToShow: 1,
Expand All @@ -20,18 +18,14 @@ const Banner = () => {
autoplaySpeed: 1800, //1.8s
afterChange: (currentSlide) => setCurrentIndex(currentSlide), //이게 인덱스값 업데이트용
};

return (
<div className="home_event">
<div className="home_event_slider_benner_wrapper">
<Slider {...settings}>
{eventBanners.map((item) => {
return (
<div
className="home_event_slider_benner"
// couponCode
onClick={() => navigate(item.redirectUrl)}
key={item}
>
<div className="home_event_slider_benner" key={item}>
<img src={item.bannerImg} alt={`Banner ${item}`} />
</div>
);
Expand Down
Loading