Skip to content

Commit bcbae35

Browse files
committed
share NEXT_DEV_TOOLS_SCALE with legacy indicator
1 parent 5b47a8c commit bcbae35

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

packages/next/src/next-devtools/dev-overlay/components/errors/dev-tools-indicator/dev-tools-info/preferences.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { useState } from 'react'
22
import {
3+
NEXT_DEV_TOOLS_SCALE,
34
STORAGE_KEY_POSITION,
45
STORAGE_KEY_SCALE,
56
STORAGE_KEY_THEME,
@@ -26,14 +27,6 @@ export function getInitialPosition() {
2627

2728
//////////////////////////////////////////////////////////////////////////////////////
2829

29-
const BASE_SIZE = 16
30-
31-
export const NEXT_DEV_TOOLS_SCALE = {
32-
Small: BASE_SIZE / 14,
33-
Medium: BASE_SIZE / 16,
34-
Large: BASE_SIZE / 18,
35-
} as const
36-
3730
export type DevToolsScale =
3831
(typeof NEXT_DEV_TOOLS_SCALE)[keyof typeof NEXT_DEV_TOOLS_SCALE]
3932

packages/next/src/next-devtools/dev-overlay/components/errors/dev-tools-indicator/dev-tools-info/user-preferences.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import { useState, type HTMLProps } from 'react'
22
import { css } from '../../../../utils/css'
33
import EyeIcon from '../../../../icons/eye-icon'
4-
import { STORAGE_KEY_POSITION, STORAGE_KEY_THEME } from '../../../../shared'
4+
import {
5+
NEXT_DEV_TOOLS_SCALE,
6+
STORAGE_KEY_POSITION,
7+
STORAGE_KEY_THEME,
8+
} from '../../../../shared'
59
import LightIcon from '../../../../icons/light-icon'
610
import DarkIcon from '../../../../icons/dark-icon'
711
import SystemIcon from '../../../../icons/system-icon'
812
import type { DevToolsInfoPropsCore } from './dev-tools-info'
913
import { DevToolsInfo } from './dev-tools-info'
1014
import {
1115
getInitialTheme,
12-
NEXT_DEV_TOOLS_SCALE,
1316
type DevToolsIndicatorPosition,
1417
type DevToolsScale,
1518
} from './preferences'

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,9 @@ export const INITIAL_OVERLAY_STATE: Omit<
229229
isDevToolsPanelOpen: false,
230230
indicatorPosition:
231231
(localStorage.getItem(STORAGE_KEY_POSITION) as Corners) ?? 'bottom-left',
232-
scale:
233-
localStorage.getItem(STORAGE_KEY_SCALE)
234-
? Number(localStorage.getItem(STORAGE_KEY_SCALE))
235-
: NEXT_DEV_TOOLS_SCALE.Medium,
232+
scale: localStorage.getItem(STORAGE_KEY_SCALE)
233+
? Number(localStorage.getItem(STORAGE_KEY_SCALE))
234+
: NEXT_DEV_TOOLS_SCALE.Medium,
236235
}
237236

238237
function getInitialState(

0 commit comments

Comments
 (0)