1
1
import type { OverlayDispatch , OverlayState } from '../../shared'
2
2
3
- import { Suspense , useRef } from 'react'
4
3
import { Dialog , DialogContent , DialogHeader , DialogBody } from '../dialog'
5
4
import { Overlay } from '../overlay/overlay'
6
- import { useFocusTrap } from '../errors/dev-tools-indicator/utils'
7
- import { useDelayedRender } from '../../hooks/use-delayed-render'
8
5
import { ACTION_DEVTOOLS_PANEL_TOGGLE } from '../../shared'
9
6
import { css } from '../../utils/css'
10
7
11
8
export function DevToolsPanel ( {
9
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
12
10
state,
13
11
dispatch,
14
12
} : {
15
13
state : OverlayState
16
14
dispatch : OverlayDispatch
17
15
} ) {
18
- const dialogRef = useRef < HTMLDivElement > ( null )
19
-
20
- // This hook lets us do an exit animation before unmounting the component
21
- const { mounted, rendered } = useDelayedRender ( state . isDevToolsPanelOpen )
22
-
23
- useFocusTrap ( dialogRef , null , rendered )
24
-
25
- if ( ! mounted ) {
26
- // Workaround React quirk that triggers "Switch to client-side rendering" if
27
- // we return no Suspense boundary here.
28
- return < Suspense />
29
- }
30
-
31
16
const onClose = ( ) => {
32
17
dispatch ( { type : ACTION_DEVTOOLS_PANEL_TOGGLE } )
33
18
}
34
19
35
20
return (
36
21
< Overlay data-nextjs-devtools-panel-overlay >
37
- < div data-nextjs-devtools-panel-container ref = { dialogRef } >
38
- < Dialog
39
- data-nextjs-devtools-panel-dialog
40
- aria-labelledby = "nextjs__container_dev_tools_panel_label"
41
- aria-describedby = "nextjs__container_dev_tools_panel_desc"
42
- onClose = { onClose }
43
- >
44
- < DialogContent >
45
- < DialogHeader > </ DialogHeader >
46
- < DialogBody > </ DialogBody >
47
- </ DialogContent >
48
- </ Dialog >
49
- </ div >
22
+ < Dialog
23
+ data-nextjs-devtools-panel-dialog
24
+ aria-labelledby = "nextjs__container_dev_tools_panel_label"
25
+ aria-describedby = "nextjs__container_dev_tools_panel_desc"
26
+ onClose = { onClose }
27
+ >
28
+ < DialogContent >
29
+ < DialogHeader > </ DialogHeader >
30
+ < DialogBody > </ DialogBody >
31
+ </ DialogContent >
32
+ </ Dialog >
50
33
</ Overlay >
51
34
)
52
35
}
@@ -57,7 +40,7 @@ export const DEVTOOLS_PANEL_STYLES = css`
57
40
top : 10vh ;
58
41
}
59
42
60
- [data-nextjs-devtools-panel-container ] {
43
+ [data-nextjs-devtools-panel-dialog ] {
61
44
-webkit-font-smoothing : antialiased;
62
45
display : flex;
63
46
flex-direction : column;
@@ -67,7 +50,7 @@ export const DEVTOOLS_PANEL_STYLES = css`
67
50
border-radius : var (--rounded-xl );
68
51
box-shadow : var (--shadow-lg );
69
52
position : relative;
70
- overflow : hidden ;
53
+ overflow-y : auto ;
71
54
72
55
/* TODO: Remove once the content is filled. */
73
56
min-width : 800px ;
@@ -76,9 +59,4 @@ export const DEVTOOLS_PANEL_STYLES = css`
76
59
/* This is handled from dialog/styles.ts */
77
60
max-width : var (--next-dialog-max-width );
78
61
}
79
-
80
- [data-nextjs-devtools-panel-dialog ] {
81
- overflow-y : auto;
82
- height : 100% ;
83
- }
84
62
`
0 commit comments