Skip to content

Commit

Permalink
only if runtime error exist
Browse files Browse the repository at this point in the history
  • Loading branch information
devjiwonchoi committed Jan 9, 2025
1 parent af65367 commit 6bf0341
Showing 1 changed file with 41 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,41 +116,47 @@ export function ErrorOverlayPagination({
}, [nav, activeIdx, readyErrors.length])

return (
<nav
className="error-overlay-pagination dialog-exclude-closing-from-outside-click"
ref={onNav}
>
<button
ref={buttonLeft}
type="button"
disabled={activeIdx === 0}
aria-disabled={activeIdx === 0}
onClick={handlePrevious}
className="error-overlay-pagination-button"
>
<LeftArrow
title="previous"
className="error-overlay-pagination-button-icon"
/>
</button>
<div className="error-overlay-pagination-count">
<span>{activeIdx + 1}/</span>
<span data-nextjs-dialog-header-total-count>{readyErrors.length}</span>
</div>
<button
ref={buttonRight}
type="button"
disabled={activeIdx === readyErrors.length - 1}
aria-disabled={activeIdx === readyErrors.length - 1}
onClick={handleNext}
className="error-overlay-pagination-button"
>
<RightArrow
title="next"
className="error-overlay-pagination-button-icon"
/>
</button>
</nav>
<>
{readyErrors.length > 0 && (
<nav
className="error-overlay-pagination dialog-exclude-closing-from-outside-click"
ref={onNav}
>
<button
ref={buttonLeft}
type="button"
disabled={activeIdx === 0}
aria-disabled={activeIdx === 0}
onClick={handlePrevious}
className="error-overlay-pagination-button"
>
<LeftArrow
title="previous"
className="error-overlay-pagination-button-icon"
/>
</button>
<div className="error-overlay-pagination-count">
<span>{activeIdx + 1}/</span>
<span data-nextjs-dialog-header-total-count>
{readyErrors.length}
</span>
</div>
<button
ref={buttonRight}
type="button"
disabled={activeIdx === readyErrors.length - 1}
aria-disabled={activeIdx === readyErrors.length - 1}
onClick={handleNext}
className="error-overlay-pagination-button"
>
<RightArrow
title="next"
className="error-overlay-pagination-button-icon"
/>
</button>
</nav>
)}
</>
)
}

Expand Down

0 comments on commit 6bf0341

Please sign in to comment.