Skip to content

Commit 09db81f

Browse files
committed
remove unnecessary
1 parent 5b87ff5 commit 09db81f

File tree

1 file changed

+14
-36
lines changed

1 file changed

+14
-36
lines changed
Lines changed: 14 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,35 @@
11
import type { OverlayDispatch, OverlayState } from '../../shared'
22

3-
import { Suspense, useRef } from 'react'
43
import { Dialog, DialogContent, DialogHeader, DialogBody } from '../dialog'
54
import { Overlay } from '../overlay/overlay'
6-
import { useFocusTrap } from '../errors/dev-tools-indicator/utils'
7-
import { useDelayedRender } from '../../hooks/use-delayed-render'
85
import { ACTION_DEVTOOLS_PANEL_TOGGLE } from '../../shared'
96
import { css } from '../../utils/css'
107

118
export function DevToolsPanel({
9+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1210
state,
1311
dispatch,
1412
}: {
1513
state: OverlayState
1614
dispatch: OverlayDispatch
1715
}) {
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-
3116
const onClose = () => {
3217
dispatch({ type: ACTION_DEVTOOLS_PANEL_TOGGLE })
3318
}
3419

3520
return (
3621
<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>
5033
</Overlay>
5134
)
5235
}
@@ -57,7 +40,7 @@ export const DEVTOOLS_PANEL_STYLES = css`
5740
top: 10vh;
5841
}
5942
60-
[data-nextjs-devtools-panel-container] {
43+
[data-nextjs-devtools-panel-dialog] {
6144
-webkit-font-smoothing: antialiased;
6245
display: flex;
6346
flex-direction: column;
@@ -67,7 +50,7 @@ export const DEVTOOLS_PANEL_STYLES = css`
6750
border-radius: var(--rounded-xl);
6851
box-shadow: var(--shadow-lg);
6952
position: relative;
70-
overflow: hidden;
53+
overflow-y: auto;
7154
7255
/* TODO: Remove once the content is filled. */
7356
min-width: 800px;
@@ -76,9 +59,4 @@ export const DEVTOOLS_PANEL_STYLES = css`
7659
/* This is handled from dialog/styles.ts */
7760
max-width: var(--next-dialog-max-width);
7861
}
79-
80-
[data-nextjs-devtools-panel-dialog] {
81-
overflow-y: auto;
82-
height: 100%;
83-
}
8462
`

0 commit comments

Comments
 (0)