Skip to content

Commit 71082fd

Browse files
committed
[devtools] set up panel ui tab infra
1 parent 75ea482 commit 71082fd

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type { DevToolsPanelTabType } from '../devtools-panel'
2+
3+
export function DevToolsPanelTab({
4+
activeTab,
5+
}: {
6+
activeTab: DevToolsPanelTabType
7+
}) {
8+
if (activeTab === 'settings') {
9+
return <div>Settings</div>
10+
}
11+
12+
if (activeTab === 'route') {
13+
return <div>Route</div>
14+
}
15+
16+
if (activeTab === 'issues') {
17+
return <div>Issues</div>
18+
}
19+
20+
console.log(
21+
`[Next.js DevTools] Received unknown Panel Tab: "${activeTab}". This is a bug in Next.js DevTools.`
22+
)
23+
return null
24+
}

packages/next/src/next-devtools/dev-overlay/components/devtools-panel/devtools-panel.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { OverlayDispatch, OverlayState } from '../../shared'
33
import { useState } from 'react'
44

55
import { DevToolsPanelFooter } from './devtools-panel-footer'
6+
import { DevToolsPanelTab } from './devtools-panel-tab/devtools-panel-tab'
67
import { Dialog, DialogContent, DialogHeader, DialogBody } from '../dialog'
78
import { Overlay } from '../overlay/overlay'
89
import {
@@ -17,6 +18,8 @@ import { INDICATOR_PADDING } from '../devtools-indicator/devtools-indicator'
1718
import { FullScreenIcon } from '../../icons/fullscreen'
1819
import { Cross } from '../../icons/cross'
1920

21+
export type DevToolsPanelTabType = 'issues' | 'route' | 'settings'
22+
2023
export function DevToolsPanel({
2124
state,
2225
dispatch,
@@ -115,7 +118,9 @@ export function DevToolsPanel({
115118
</div>
116119
</div>
117120
</DialogHeader>
118-
<DialogBody></DialogBody>
121+
<DialogBody>
122+
<DevToolsPanelTab activeTab={activeTab} />
123+
</DialogBody>
119124
</DialogContent>
120125
<DevToolsPanelFooter versionInfo={state.versionInfo} />
121126
</Dialog>

0 commit comments

Comments
 (0)