Skip to content

Commit 7b9435f

Browse files
committed
[devtools] set up panel ui tab infra
1 parent 2d595ff commit 7b9435f

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
@@ -26,6 +26,9 @@ function getInitialPosition(): Corners {
2626
import { FullScreenIcon } from '../../icons/fullscreen'
2727
import { Cross } from '../../icons/cross'
2828
import { DevToolsPanelFooter } from './devtools-panel-footer'
29+
import { DevToolsPanelTab } from './devtools-panel-tab/devtools-panel-tab'
30+
31+
export type DevToolsPanelTabType = 'issues' | 'route' | 'settings'
2932

3033
export function DevToolsPanel({
3134
state,
@@ -134,7 +137,9 @@ export function DevToolsPanel({
134137
</div>
135138
</div>
136139
</DialogHeader>
137-
<DialogBody></DialogBody>
140+
<DialogBody>
141+
<DevToolsPanelTab activeTab={activeTab} />
142+
</DialogBody>
138143
</DialogContent>
139144
</Dialog>
140145
<DevToolsPanelFooter versionInfo={state.versionInfo} />

0 commit comments

Comments
 (0)