Add persistent gallery card ratio switch
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 18s
This commit is contained in:
parent
bd4059c9c1
commit
3f86d863ac
10 changed files with 72 additions and 10 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// Rôle : affiche la collection d'un outil Images dans la galerie de la visionneuse.
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
export function ImageGallery({ images, activeIndex, focusIndex = -1, thumbnailWidth = 260, onSelect, textContent = {} }) {
|
||||
export function ImageGallery({ images, activeIndex, focusIndex = -1, thumbnailWidth = 260, cardRatio = "4:3", onSelect, textContent = {} }) {
|
||||
const galleryRef = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -13,7 +13,7 @@ export function ImageGallery({ images, activeIndex, focusIndex = -1, thumbnailWi
|
|||
}, [focusIndex]);
|
||||
|
||||
return (
|
||||
<div ref={galleryRef} className="image-viewer-gallery themed-scrollbar" style={{ "--image-gallery-thumbnail-width": `${thumbnailWidth}px` }}>
|
||||
<div ref={galleryRef} className="image-viewer-gallery themed-scrollbar" data-card-ratio={cardRatio} style={{ "--image-gallery-thumbnail-width": `${thumbnailWidth}px` }}>
|
||||
{images.map((image, index) => {
|
||||
const position = `${index + 1} / ${images.length}`;
|
||||
const label = image.label || `${textContent.imageAlt || "Image"} ${index + 1}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue