Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan committed May 1, 2024
1 parent eded2c0 commit 2c6578f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/Lightbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const Lightbox = ({ index, onClose, onDelete, photos, title, description, conten
<ImageView
images={photos.map((photo) => ({ uri: photo }))}
onImageIndexChange={setImageIndex}
imageIndex={initialIndex}
imageIndex={imageIndex ?? 0}
visible={index !== undefined}
swipeToCloseEnabled={false}
onRequestClose={onClose}
Expand Down
6 changes: 3 additions & 3 deletions src/components/PageIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type Props = {
}

const PageIndicator = ({ currentPage, numberOfPages }: Props) => {
Log.debug('PageIndicator', currentPage, numberOfPages)
Log.trace('PageIndicator', currentPage, numberOfPages)

const getIndicators = () => {
Log.debug('PageIndicator:getIndicators')
Log.trace('PageIndicator:getIndicators')

if (numberOfPages <= 1) return []

Expand All @@ -28,7 +28,7 @@ const PageIndicator = ({ currentPage, numberOfPages }: Props) => {
const hasLeftOverflowDot = hasOverflowDots && currentPage > middleDot
const hasRightOverflowDot = hasOverflowDots && currentPage <= numberOfPages - middleDot
const currentDot = (() => {
Log.debug('PageIndicator:getIndicators')
Log.trace('PageIndicator:getIndicators')

if (hasLeftOverflowDot && hasRightOverflowDot) return middleDot - 1
if (hasLeftOverflowDot) return maximumNumberOfDots - 1 - (numberOfPages - currentPage)
Expand Down

0 comments on commit 2c6578f

Please sign in to comment.