Skip to content

Commit 4728b40

Browse files
committed
Make footer a sibling
1 parent 9098788 commit 4728b40

File tree

3 files changed

+24
-33
lines changed

3 files changed

+24
-33
lines changed

packages/next/src/client/components/react-dev-overlay/ui/components/dialog/dialog.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export type DialogProps = {
1010
className?: string
1111
onClose?: () => void
1212
dialogResizerRef?: React.RefObject<HTMLDivElement | null>
13-
footer?: React.ReactNode
1413
} & React.HTMLAttributes<HTMLDivElement>
1514

1615
const CSS_SELECTORS_TO_EXCLUDE_ON_CLICK_OUTSIDE = [
@@ -29,7 +28,6 @@ const Dialog: React.FC<DialogProps> = function Dialog({
2928
'aria-labelledby': ariaLabelledBy,
3029
'aria-describedby': ariaDescribedBy,
3130
dialogResizerRef,
32-
footer,
3331
...props
3432
}) {
3533
const dialogRef = React.useRef<HTMLDivElement | null>(null)
@@ -117,7 +115,6 @@ const Dialog: React.FC<DialogProps> = function Dialog({
117115
>
118116
<div ref={ref}>{children}</div>
119117
</div>
120-
{footer}
121118
</div>
122119
)
123120
}

packages/next/src/client/components/react-dev-overlay/ui/components/dialog/styles.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const styles = `
22
[data-nextjs-dialog-root] {
33
--next-dialog-radius: var(--rounded-xl);
4-
--next-dialog-footer-height: var(--size-48);
54
--next-dialog-max-width: 960px;
65
--next-dialog-row-padding: 16px;
76
--next-dialog-padding-x: 12px;
@@ -77,7 +76,6 @@ const styles = `
7776
}
7877
7978
[data-nextjs-dialog-content] {
80-
overflow-y: auto;
8179
border: none;
8280
margin: 0;
8381
display: flex;
@@ -97,9 +95,8 @@ const styles = `
9795
}
9896
9997
[data-nextjs-dialog-footer] {
100-
position: sticky;
98+
position: relative;
10199
bottom: 0;
102-
&, > * { min-height: var(--next-dialog-footer-height); }
103100
}
104101
105102
@media (max-height: 812px) {

packages/next/src/client/components/react-dev-overlay/ui/components/errors/dialog/dialog.tsx

+23-26
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,41 @@ type ErrorOverlayDialogProps = {
1010
export function ErrorOverlayDialog({
1111
children,
1212
onClose,
13+
footer,
1314
...props
1415
}: ErrorOverlayDialogProps) {
1516
return (
16-
<Dialog
17-
type="error"
18-
aria-labelledby="nextjs__container_errors_label"
19-
aria-describedby="nextjs__container_errors_desc"
20-
onClose={onClose}
21-
className="error-overlay-dialog"
22-
{...props}
23-
>
24-
{children}
25-
</Dialog>
17+
<div className="error-overlay-dialog-container">
18+
<Dialog
19+
type="error"
20+
aria-labelledby="nextjs__container_errors_label"
21+
aria-describedby="nextjs__container_errors_desc"
22+
className="error-overlay-dialog-scroll"
23+
onClose={onClose}
24+
{...props}
25+
>
26+
{children}
27+
</Dialog>
28+
{footer}
29+
</div>
2630
)
2731
}
2832

2933
export const DIALOG_STYLES = `
30-
.error-overlay-dialog {
31-
overflow-y: auto;
32-
-webkit-font-smoothing: antialiased;
34+
.error-overlay-dialog-container {
35+
display: flex;
36+
flex-direction: column;
3337
background: var(--color-background-100);
3438
background-clip: padding-box;
3539
border: var(--next-dialog-border-width) solid var(--color-gray-400);
36-
border-radius: var(--rounded-xl);
40+
border-radius: 0 0 var(--next-dialog-radius) var(--next-dialog-radius);
3741
box-shadow: var(--shadow-menu);
3842
position: relative;
43+
overflow: hidden;
44+
}
3945
40-
&:has(
41-
~ [data-nextjs-error-overlay-nav] .error-overlay-notch[data-side='left']
42-
) {
43-
border-top-left-radius: 0;
44-
}
45-
46-
&:has(
47-
~ [data-nextjs-error-overlay-nav]
48-
.error-overlay-notch[data-side='right']
49-
) {
50-
border-top-right-radius: 0;
51-
}
46+
.error-overlay-dialog-scroll {
47+
overflow-y: auto;
48+
height: 100%;
5249
}
5350
`

0 commit comments

Comments
 (0)