Skip to content

Commit

Permalink
refactor: mock 데이터 쓰는 코드 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
CheeseB committed Apr 1, 2024
1 parent c6a4266 commit 9d6681f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
7 changes: 3 additions & 4 deletions src/components/postDetail/ImageSlide/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import classNames from 'classnames/bind';
import { SVGS } from '@/constants';

import ImageModal from '@/components/postDetail/ImageModal';
import { IMAGE_LIST } from '@/constants/mockData/imageList';
import useToggleButton from '@/hooks/useToggleButton';

import styles from './ImageSlide.module.scss';
Expand All @@ -23,7 +22,7 @@ type ImageSlideProps = {
imageList?: string[];
};

const ImageSlide = ({ imageList = IMAGE_LIST }: ImageSlideProps) => {
const ImageSlide = ({ imageList }: ImageSlideProps) => {
const [selectedImageSrc, setSelectedImageSrc] = useState('');
const ref = useRef<HTMLDivElement>(null);
const { isVisible, handleToggleClick } = useToggleButton();
Expand All @@ -41,7 +40,7 @@ const ImageSlide = ({ imageList = IMAGE_LIST }: ImageSlideProps) => {
};

const handleImageClick = (index: number) => {
setSelectedImageSrc(imageList[index]);
setSelectedImageSrc(imageList?.[index] ?? '');
handleToggleClick();
};

Expand All @@ -55,7 +54,7 @@ const ImageSlide = ({ imageList = IMAGE_LIST }: ImageSlideProps) => {
</button>
<div className={cx('container')} ref={ref}>
<div className={cx('container-slider')}>
{imageList.map((item, index) => (
{imageList?.map((item, index) => (
<button
className={cx('container-slider-banner')}
key={`image-slide-${index}`}
Expand Down
19 changes: 0 additions & 19 deletions src/stories/ImageModal.stories.ts

This file was deleted.

0 comments on commit 9d6681f

Please sign in to comment.