Hide previous/next buttons in fullscreen lightbox

This commit is contained in:
Fedor Indutny 2021-08-31 18:19:18 -07:00 committed by GitHub
parent 6f3191117f
commit 1858b15588
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"
/> />