修复play页面照片墙的问题

This commit is contained in:
mtvpls
2026-04-09 21:44:15 +08:00
parent 769dbf8310
commit 6b4555346d
+40 -26
View File
@@ -1045,31 +1045,7 @@ const DetailPanel: React.FC<DetailPanelProps> = ({
return { visibleItems, totalHeight, usedWidth }; return { visibleItems, totalHeight, usedWidth };
}, [galleryImages, galleryScrollTop, galleryViewportHeight, galleryViewportWidth]); }, [galleryImages, galleryScrollTop, galleryViewportHeight, galleryViewportWidth]);
const galleryModal = showGallery ? ( const galleryBody = (
<div className="fixed inset-0 z-[10000] flex items-center justify-center p-4">
<div
className="absolute inset-0 bg-black/60"
onClick={() => setShowGallery(false)}
/>
<div className="relative w-full max-w-6xl max-h-[90vh] bg-white dark:bg-gray-900 rounded-2xl shadow-2xl overflow-hidden flex flex-col">
<div className="flex items-center justify-between p-4 border-b border-gray-100 dark:border-gray-800">
<div>
<h3 className="text-lg font-semibold text-gray-900 dark:text-gray-100"></h3>
{!galleryLoading && (
<p className="text-sm text-gray-500 dark:text-gray-400">
{galleryTotal}
</p>
)}
</div>
<button
onClick={() => setShowGallery(false)}
className="p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
aria-label="关闭照片墙"
>
<X size={20} className="text-gray-500 dark:text-gray-400" />
</button>
</div>
<div ref={galleryScrollRef} className="flex-1 overflow-y-auto overflow-x-hidden p-4"> <div ref={galleryScrollRef} className="flex-1 overflow-y-auto overflow-x-hidden p-4">
{galleryLoading && ( {galleryLoading && (
<div className="flex items-center justify-center py-20"> <div className="flex items-center justify-center py-20">
@@ -1131,9 +1107,47 @@ const DetailPanel: React.FC<DetailPanelProps> = ({
</div> </div>
)} )}
</div> </div>
);
const galleryHeader = (
<div className="flex items-center justify-between p-4 border-b border-gray-100 dark:border-gray-800">
<div>
<h3 className="text-lg font-semibold text-gray-900 dark:text-gray-100"></h3>
{!galleryLoading && (
<p className="text-sm text-gray-500 dark:text-gray-400">
{galleryTotal}
</p>
)}
</div>
<button
onClick={() => setShowGallery(false)}
className="p-2 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
aria-label="关闭照片墙"
>
<X size={20} className="text-gray-500 dark:text-gray-400" />
</button>
</div>
);
const galleryModal = showGallery ? (useDrawer ? (
<div className="fixed inset-0 z-[10000] flex items-center justify-end pointer-events-none">
<div className={`relative ${drawerWidth} h-full bg-white dark:bg-gray-900 shadow-2xl overflow-hidden flex flex-col pointer-events-auto`}>
{galleryHeader}
{galleryBody}
</div> </div>
</div> </div>
) : null; ) : (
<div className="fixed inset-0 z-[10000] flex items-center justify-center p-4">
<div
className="absolute inset-0 bg-black/60"
onClick={() => setShowGallery(false)}
/>
<div className="relative w-full max-w-6xl max-h-[90vh] bg-white dark:bg-gray-900 rounded-2xl shadow-2xl overflow-hidden flex flex-col">
{galleryHeader}
{galleryBody}
</div>
</div>
)) : null;
if (!isVisible || !mounted) return null; if (!isVisible || !mounted) return null;