diff --git a/frontend-temp/src/pages/album/mobile/AlbumDetail.jsx b/frontend-temp/src/pages/album/mobile/AlbumDetail.jsx index d7a2ce7..c956e50 100644 --- a/frontend-temp/src/pages/album/mobile/AlbumDetail.jsx +++ b/frontend-temp/src/pages/album/mobile/AlbumDetail.jsx @@ -13,6 +13,9 @@ import { ChevronUp, FileText, ChevronRight, + Info, + Users, + Tag, } from 'lucide-react'; import { Swiper, SwiperSlide } from 'swiper/react'; import { Virtual } from 'swiper/modules'; @@ -30,6 +33,7 @@ function MobileAlbumDetail() { const [lightbox, setLightbox] = useState({ open: false, images: [], index: 0, showNav: true, teasers: null, photos: null }); const [showAllTracks, setShowAllTracks] = useState(false); const [showDescriptionModal, setShowDescriptionModal] = useState(false); + const [showPhotoInfo, setShowPhotoInfo] = useState(false); const swiperRef = useRef(null); // 앨범 데이터 로드 @@ -58,10 +62,18 @@ function MobileAlbumDetail() { window.history.pushState({ description: true }, ''); }, []); + // 사진 정보 바텀시트 열기 + const openPhotoInfo = useCallback(() => { + setShowPhotoInfo(true); + window.history.pushState({ photoInfo: true }, ''); + }, []); + // 뒤로가기 처리 useEffect(() => { const handlePopState = () => { - if (showDescriptionModal) { + if (showPhotoInfo) { + setShowPhotoInfo(false); + } else if (showDescriptionModal) { setShowDescriptionModal(false); } else if (lightbox.open) { setLightbox((prev) => ({ ...prev, open: false })); @@ -70,7 +82,7 @@ function MobileAlbumDetail() { window.addEventListener('popstate', handlePopState); return () => window.removeEventListener('popstate', handlePopState); - }, [showDescriptionModal, lightbox.open]); + }, [showPhotoInfo, showDescriptionModal, lightbox.open]); // 이미지 다운로드 const downloadImage = useCallback(async () => { @@ -384,112 +396,159 @@ function MobileAlbumDetail() { {/* 라이트박스 - Swiper ViewPager 스타일 */} - {lightbox.open && ( - - {/* 상단 헤더 */} -
-
- -
- {lightbox.showNav && lightbox.images.length > 1 && ( - - {lightbox.index + 1} / {lightbox.images.length} - - )} -
- -
-
+ {lightbox.open && (() => { + const currentPhoto = lightbox.photos?.[lightbox.index]; + const concept = currentPhoto?.title; + const hasValidConcept = concept && concept.trim() && concept !== 'Default'; + const members = currentPhoto?.members; + const hasMembers = members && String(members).trim(); + const hasPhotoInfo = hasValidConcept || hasMembers; - {/* Swiper */} - { - swiperRef.current = swiper; - }} - onSlideChange={(swiper) => setLightbox((prev) => ({ ...prev, index: swiper.activeIndex }))} - className="w-full h-full" - spaceBetween={0} - slidesPerView={1} - resistance={true} - resistanceRatio={0.5} + return ( + - {lightbox.images.map((url, index) => ( - -
- {lightbox.teasers?.[index]?.media_type === 'video' ? ( -