Skip to content

Commit 547e229

Browse files
committed
no need extra panel ui position
1 parent fcaaaac commit 547e229

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,17 @@ import { useState } from 'react'
44

55
import { Dialog, DialogContent, DialogHeader, DialogBody } from '../dialog'
66
import { Overlay, OverlayBackdrop } from '../overlay'
7-
import {
8-
ACTION_DEVTOOLS_PANEL_CLOSE,
9-
STORAGE_KEY_DEVTOOLS_PANEL_POSITION,
10-
} from '../../shared'
7+
import { ACTION_DEVTOOLS_PANEL_CLOSE, STORAGE_KEY_POSITION } from '../../shared'
118
import { css } from '../../utils/css'
129
import { Draggable } from '../errors/dev-tools-indicator/draggable'
1310
import { INDICATOR_PADDING } from '../devtools-indicator/devtools-indicator'
1411

1512
function getInitialPosition(): Corners {
1613
if (
1714
typeof localStorage !== 'undefined' &&
18-
localStorage.getItem(STORAGE_KEY_DEVTOOLS_PANEL_POSITION)
15+
localStorage.getItem(STORAGE_KEY_POSITION)
1916
) {
20-
return localStorage.getItem(STORAGE_KEY_DEVTOOLS_PANEL_POSITION) as Corners
17+
return localStorage.getItem(STORAGE_KEY_POSITION) as Corners
2118
}
2219
return (process.env.__NEXT_DEV_INDICATOR_POSITION || 'bottom-left') as Corners
2320
}
@@ -58,8 +55,10 @@ export function DevToolsPanel({
5855
onDragStart={() => {}}
5956
position={position}
6057
setPosition={(p) => {
61-
localStorage.setItem(STORAGE_KEY_DEVTOOLS_PANEL_POSITION, p)
58+
localStorage.setItem(STORAGE_KEY_POSITION, p)
6259
setPosition(p)
60+
61+
console.log({ STORAGE_KEY_POSITION, p })
6362
}}
6463
>
6564
<Dialog

packages/next/src/next-devtools/dev-overlay/shared.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ export const ACTION_DEVTOOLS_PANEL_TOGGLE = 'devtools-panel-toggle'
6161

6262
export const STORAGE_KEY_THEME = '__nextjs-dev-tools-theme'
6363
export const STORAGE_KEY_POSITION = '__nextjs-dev-tools-position'
64-
export const STORAGE_KEY_DEVTOOLS_PANEL_POSITION =
65-
'__nextjs-dev-tools-panel-position'
6664
export const STORAGE_KEY_SCALE = '__nextjs-dev-tools-scale'
6765

6866
interface StaticIndicatorAction {

0 commit comments

Comments
 (0)