Unverified Commit 3caa9960 authored by Arsalan Khattak's avatar Arsalan Khattak Committed by GitHub

Error overlay should not be dismissable for a server error (#14011)

parent ce56b601
......@@ -5,7 +5,7 @@ export type DialogProps = {
type: 'error' | 'warning'
'aria-labelledby': string
'aria-describedby': string
onClose: (e: MouseEvent | TouchEvent) => void
onClose?: (e: MouseEvent | TouchEvent) => void
}
const Dialog: React.FC<DialogProps> = function Dialog({
......
......@@ -4,7 +4,7 @@ export type LeftRightDialogHeaderProps = {
className?: string
previous: (() => void) | null
next: (() => void) | null
close: () => void
close?: () => void
}
const LeftRightDialogHeader: React.FC<LeftRightDialogHeaderProps> = function LeftRightDialogHeader({
......@@ -142,37 +142,39 @@ const LeftRightDialogHeader: React.FC<LeftRightDialogHeaderProps> = function Lef
&nbsp;
{children}
</nav>
<button
ref={buttonClose}
type="button"
onClick={close}
aria-label="Close"
>
<span aria-hidden="true">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M18 6L6 18"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M6 6L18 18"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
</span>
</button>
{close && (
<button
ref={buttonClose}
type="button"
onClick={close}
aria-label="Close"
>
<span aria-hidden="true">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M18 6L6 18"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M6 6L18 18"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
</span>
</button>
)}
</div>
)
}
......
......@@ -252,14 +252,14 @@ export const Errors: React.FC<ErrorsProps> = function Errors({ errors }) {
type="error"
aria-labelledby="nextjs__container_errors_label"
aria-describedby="nextjs__container_errors_desc"
onClose={minimize}
onClose={!isServerError && minimize}
>
<DialogContent>
<DialogHeader className="nextjs-container-errors-header">
<LeftRightDialogHeader
previous={activeIdx > 0 ? previous : null}
next={activeIdx < readyErrors.length - 1 ? next : null}
close={minimize}
close={!isServerError && minimize}
>
<small>
<span>{activeIdx + 1}</span> of{' '}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment