Hide previous/next buttons in fullscreen lightbox
This commit is contained in:
parent
6f3191117f
commit
1858b15588
1 changed files with 2 additions and 4 deletions
|
@ -301,8 +301,8 @@ export function Lightbox({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasNext = selectedIndex < media.length - 1;
|
const hasNext = !zoomed && selectedIndex < media.length - 1;
|
||||||
const hasPrevious = selectedIndex > 0;
|
const hasPrevious = !zoomed && selectedIndex > 0;
|
||||||
|
|
||||||
return root
|
return root
|
||||||
? createPortal(
|
? createPortal(
|
||||||
|
@ -381,7 +381,6 @@ export function Lightbox({
|
||||||
<button
|
<button
|
||||||
aria-label={i18n('previous')}
|
aria-label={i18n('previous')}
|
||||||
className="Lightbox__button Lightbox__button--previous"
|
className="Lightbox__button Lightbox__button--previous"
|
||||||
disabled={zoomed}
|
|
||||||
onClick={onPrevious}
|
onClick={onPrevious}
|
||||||
type="button"
|
type="button"
|
||||||
/>
|
/>
|
||||||
|
@ -392,7 +391,6 @@ export function Lightbox({
|
||||||
<button
|
<button
|
||||||
aria-label={i18n('next')}
|
aria-label={i18n('next')}
|
||||||
className="Lightbox__button Lightbox__button--next"
|
className="Lightbox__button Lightbox__button--next"
|
||||||
disabled={zoomed}
|
|
||||||
onClick={onNext}
|
onClick={onNext}
|
||||||
type="button"
|
type="button"
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue