@@ -32,6 +32,7 @@ export interface OverlayState {
32
32
routerType : 'pages' | 'app'
33
33
isErrorOverlayOpen : boolean
34
34
isDevToolsPanelOpen : boolean
35
+ indicatorPosition : Corners
35
36
}
36
37
export type OverlayDispatch = React . Dispatch < DispatcherEvent >
37
38
@@ -59,6 +60,8 @@ export const ACTION_DEVTOOLS_PANEL_OPEN = 'devtools-panel-open'
59
60
export const ACTION_DEVTOOLS_PANEL_CLOSE = 'devtools-panel-close'
60
61
export const ACTION_DEVTOOLS_PANEL_TOGGLE = 'devtools-panel-toggle'
61
62
63
+ export const ACTION_DEVTOOLS_INDICATOR_POSITION = 'dev-tools-indicator-position'
64
+
62
65
export const STORAGE_KEY_THEME = '__nextjs-dev-tools-theme'
63
66
export const STORAGE_KEY_POSITION = '__nextjs-dev-tools-position'
64
67
export const STORAGE_KEY_DEVTOOLS_PANEL_POSITION =
@@ -142,6 +145,11 @@ export interface DevToolsPanelToggleAction {
142
145
type : typeof ACTION_DEVTOOLS_PANEL_TOGGLE
143
146
}
144
147
148
+ export interface DevToolsIndicatorPositionAction {
149
+ type : typeof ACTION_DEVTOOLS_INDICATOR_POSITION
150
+ indicatorPosition : Corners
151
+ }
152
+
145
153
export type DispatcherEvent =
146
154
| BuildOkAction
147
155
| BuildErrorAction
@@ -163,6 +171,7 @@ export type DispatcherEvent =
163
171
| DevToolsPanelOpenAction
164
172
| DevToolsPanelCloseAction
165
173
| DevToolsPanelToggleAction
174
+ | DevToolsIndicatorPositionAction
166
175
167
176
const REACT_ERROR_STACK_BOTTOM_FRAME_REGEX =
168
177
// 1st group: v8
@@ -202,6 +211,7 @@ export const INITIAL_OVERLAY_STATE: Omit<
202
211
versionInfo : { installed : '0.0.0' , staleness : 'unknown' } ,
203
212
debugInfo : { devtoolsFrontendUrl : undefined } ,
204
213
isDevToolsPanelOpen : false ,
214
+ indicatorPosition : 'bottom-left' ,
205
215
}
206
216
207
217
function getInitialState (
@@ -373,6 +383,9 @@ export function useErrorOverlayReducer(
373
383
case ACTION_DEVTOOLS_PANEL_TOGGLE : {
374
384
return { ...state , isDevToolsPanelOpen : ! state . isDevToolsPanelOpen }
375
385
}
386
+ case ACTION_DEVTOOLS_INDICATOR_POSITION : {
387
+ return { ...state , indicatorPosition : action . indicatorPosition }
388
+ }
376
389
default : {
377
390
return state
378
391
}
0 commit comments