Skip to content

Commit

Permalink
fix: EventCarousel type error 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
chaeminseok committed Jul 11, 2024
1 parent 346b77a commit a79783a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/pages/homePage/eventCarousel/EventCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,35 @@ interface EventItem {
title1: string;
title2: string;
}

interface EventCarouselProps {
EventCarouselContents: EventItem[];
arrows?: boolean;
height?: number;
height?: number; // height props를 undefined로 허용
infinite?: boolean;
innerShadow?: boolean;
draggable?: boolean;
auto?: boolean;
}

const EventCarousel: React.FC<EventCarouselProps> = ({
EventCarouselContents,
arrows,
height,
height = 300,
infinite,
draggable,
}) => {
const navigate = useNavigate();
const { slideWidth, sliderRef } = useCarouselSize();

const slideList = infinite
? [
EventCarouselContents.at(-1),
...EventCarouselContents,
EventCarouselContents.at(0),
]
: EventCarouselContents;

const {
currentIndex,
getSliderStyle,
Expand All @@ -49,6 +53,7 @@ const EventCarousel: React.FC<EventCarouselProps> = ({
infinite,
slideWidth,
});

const onClickHandler = (id: number) => {
navigate(`${PATH.MAIN_DETAIL}?id=${id}`);
};
Expand Down
4 changes: 0 additions & 4 deletions src/pages/mainDetailPage/MainDetail.style.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from "styled-components";
import TopButtonIcon from "@/assets/icons/ic_top_button.svg?react";

export const Container = styled.main`
background-color: ${({ theme }) => theme.color.greyScale7};
Expand All @@ -22,9 +21,6 @@ export const SearchItemFlex = styled.div`
padding: 0 20px;
`;

interface TopButtonProps {
$visible: boolean;
}
export const TopButtonCover = styled.div`
position: fixed;
width: 100%;
Expand Down

0 comments on commit a79783a

Please sign in to comment.