Skip to content

Commit

Permalink
Hide previous/next buttons in fullscreen lightbox
Browse files Browse the repository at this point in the history
  • Loading branch information
indutny-signal committed Sep 1, 2021
1 parent 6f31911 commit 1858b15
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ts/components/Lightbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ export function Lightbox({
}
}

const hasNext = selectedIndex < media.length - 1;
const hasPrevious = selectedIndex > 0;
const hasNext = !zoomed && selectedIndex < media.length - 1;
const hasPrevious = !zoomed && selectedIndex > 0;

return root
? createPortal(
Expand Down Expand Up @@ -381,7 +381,6 @@ export function Lightbox({
<button
aria-label={i18n('previous')}
className="Lightbox__button Lightbox__button--previous"
disabled={zoomed}
onClick={onPrevious}
type="button"
/>
Expand All @@ -392,7 +391,6 @@ export function Lightbox({
<button
aria-label={i18n('next')}
className="Lightbox__button Lightbox__button--next"
disabled={zoomed}
onClick={onNext}
type="button"
/>
Expand Down

0 comments on commit 1858b15

Please sign in to comment.