@@ -15,6 +15,7 @@ export function ImageGallery({
15
15
const [ imageSrc , setImageSrc ] = useState < string | undefined > ( undefined ) ;
16
16
const [ slideNumber , setSlideNumber ] = useState ( 1 ) ;
17
17
const [ showModalControls , setShowModalControls ] = useState ( false ) ;
18
+ const [ showThumbnails , setShowThumbnails ] = useState ( false ) ;
18
19
const [ fullscreen , setFullscreen ] = useState ( false ) ;
19
20
const dialogRef = useRef < HTMLDialogElement | null > ( null ) ;
20
21
const lightboxRef = useRef < HTMLElement | null > ( null ) ;
@@ -201,6 +202,17 @@ export function ImageGallery({
201
202
...modalToolbarStyle ,
202
203
} }
203
204
>
205
+ < button
206
+ type = "button"
207
+ aria-label = "Show thumbnails"
208
+ style = { modalToolbarBtnStyle }
209
+ title = "Show thumbnails"
210
+ onClick = { ( ) => setShowThumbnails ( ! showThumbnails ) }
211
+ >
212
+ { SvgElement (
213
+ < path d = "M1 2a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1zM1 12a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1zm5 0a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1z" />
214
+ ) }
215
+ </ button >
204
216
< button
205
217
type = "button"
206
218
aria-label = "Go full screen (Keyboard shortcut f)"
@@ -241,7 +253,12 @@ export function ImageGallery({
241
253
) }
242
254
</ button >
243
255
</ span >
244
- < section style = { modalSlideShowSectionStyle } >
256
+ < section
257
+ style = { {
258
+ height : showThumbnails ? "80vh" : "100vh" ,
259
+ ...modalSlideShowSectionStyle ,
260
+ } }
261
+ >
245
262
< button
246
263
type = "button"
247
264
aria-label = "Previous image"
@@ -263,7 +280,10 @@ export function ImageGallery({
263
280
< img
264
281
src = { imageSrc }
265
282
alt = { imagesInfoArray [ slideNumber - 1 ] . alt }
266
- style = { modalImageStyle }
283
+ style = { {
284
+ height : showThumbnails ? "80vh" : "100vh" ,
285
+ ...modalImageStyle ,
286
+ } }
267
287
/>
268
288
< button
269
289
type = "button"
@@ -284,7 +304,12 @@ export function ImageGallery({
284
304
) }
285
305
</ button >
286
306
</ section >
287
- < section style = { modalThumbnailSectionStyle } >
307
+ < section
308
+ style = { {
309
+ opacity : showThumbnails ? 1 : 0 ,
310
+ ...modalThumbnailSectionStyle ,
311
+ } }
312
+ >
288
313
{ imagesInfoArray . map ( ( imageInfo , index ) => (
289
314
< img
290
315
ref = { slideNumber - 1 === index ? activeThumbImgRef : null }
0 commit comments