diff --git a/src/components/carousels/customPaginationSilder/index.jsx b/src/components/carousels/customPaginationSilder/index.jsx index 6f19c60..d44da0f 100644 --- a/src/components/carousels/customPaginationSilder/index.jsx +++ b/src/components/carousels/customPaginationSilder/index.jsx @@ -15,6 +15,8 @@ import ChatApp from 'src/components/chat'; import PanZoom from 'react-easy-panzoom'; import Image from 'next/image'; +import ZoomInIcon from '@mui/icons-material/ZoomIn'; +import SellIcon from '@mui/icons-material/Sell'; const variants = { enter: (direction) => { @@ -59,80 +61,127 @@ function ProductDetailsCarousel({ ...props }) { const { slug, item, meta } = props; const [modal, setModal] = useState(); const [priceTag, setPriceTag] = useState(true); + const [bigImg, setBigImg] = useState(false); // JSON 문자열인 meta를 객체 배열로 파싱 const annotations = meta && typeof meta === 'string' ? JSON.parse(meta) : meta; return (
-
- + setPriceTag(!priceTag)} + sx={{ position: 'absolute', right: 45, bottom: 0, zIndex: 3, backgroundColor: 'white' }} + > + + + setBigImg(!bigImg)} + sx={{ position: 'absolute', right: 0, bottom: 0, zIndex: 3, backgroundColor: 'white' }} + > + + - {item && ( - hero-carousel - )} + {item && hero-carousel} - {/* 저장된 금액 표시 */} + {/* 저장된 금액 표시 */} - {annotations - ? annotations.map((annotation, idx) => ( - + )) + : ''} + {modal && ( + + + + setModal(false)} sx={{ position: 'absolute', - top: `${annotation.y * 100}%`, // 상대값을 퍼센트로 변환 - left: `${annotation.x * 100}%`, - transform: 'translate(-50%, -50%)', // 중앙 정렬 - backgroundColor: 'rgba(0,0,0,0.7)', - color: '#fff', - padding: '2px 5px', - borderRadius: '4px', - display: priceTag ? 'block' : 'none' + right: 5, + top: 5, + zIndex: 111 }} - onClick={() => setModal(true)} > - - {annotation.id}: {annotation.price} - - - )) - : ''} - {modal && ( - - - - setModal(false)} - sx={{ - position: 'absolute', - right: 5, - top: 5, - zIndex: 111 - }} - > - - - - + + - - )} -
+ + + + )} + {bigImg && ( + + + + setBigImg(false)} + sx={{ + position: 'absolute', + right: 5, + top: 5, + zIndex: 111 + }} + > + + + + {item && ( + + + hero-carousel + {annotations + ? annotations.map((annotation, idx) => ( + + )) + : ''} + + + )} + + + )}
); }