瀏覽代碼

Fix Fullscreen bug

Sviluppo_Carrello_Immagini
Lorenzo Pollutri 4 天之前
父節點
當前提交
d781432910
共有 1 個檔案被更改,包括 3 行新增5 行删除
  1. +3
    -5
      components/PublicGrid.tsx

+ 3
- 5
components/PublicGrid.tsx 查看文件

@@ -342,11 +342,9 @@ export default function PublicGrid({ cards, maxCols = 5 }: { cards: Card[], maxC
key={card.id}
onClick={() => {
setActiveCard(card);
// If any extraMedia item is flagged auto-fullscreen, open it immediately.
// The carousel's index 0 is the cover image; extraMedia starts at offset 1 (or 0 if no cover).
const offset = card.imageUrl ? 1 : 0;
const idx = (card.extraMedia || []).findIndex(m => m.autoFullscreen);
if (idx >= 0) setFullscreenIndex(offset + idx);
// If any media item is flagged auto-fullscreen, open the viewer from the start.
const triggers = (card.extraMedia || []).some(m => m.autoFullscreen);
if (triggers) setFullscreenIndex(0);
}}
className="group relative cursor-pointer overflow-hidden rounded-xl shadow-md aspect-square bg-gray-200 transition-all duration-300 hover:shadow-xl hover:-translate-y-1"
>


Loading…
取消
儲存