Skip to content

Commit 34e94ad

Browse files
committed
[devtools] panel ui responsiveness
1 parent ac59bda commit 34e94ad

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export function DevToolsPanel({
7272
onClick={onCloseDevToolsPanel}
7373
/>
7474
<Draggable
75+
data-nextjs-devtools-panel-draggable
7576
padding={INDICATOR_PADDING}
7677
onDragStart={() => {}}
7778
position={state.devToolsPosition}
@@ -160,13 +161,40 @@ export const DEVTOOLS_PANEL_STYLES = css`
160161
margin: auto;
161162
/* TODO: This is for fullscreen mode. */
162163
/* top: 10vh; */
164+
165+
width: 100%;
166+
167+
@media (min-width: 576px) {
168+
max-width: 540px;
169+
}
170+
171+
@media (min-width: 768px) {
172+
max-width: 720px;
173+
}
174+
175+
@media (min-width: 992px) {
176+
max-width: 960px;
177+
}
178+
179+
@media (min-width: 1200px) {
180+
max-width: 1140px;
181+
}
182+
183+
@media (min-width: 1440px) {
184+
max-width: 1200px;
185+
}
163186
}
164187
165188
[data-nextjs-devtools-panel-overlay-backdrop] {
166189
/* TODO: Blur on fullscreen mode. */
167190
opacity: 0;
168191
}
169192
193+
[data-nextjs-devtools-panel-draggable] {
194+
/* For responsiveness */
195+
width: 100%;
196+
}
197+
170198
[data-nextjs-devtools-panel-dialog] {
171199
-webkit-font-smoothing: antialiased;
172200
display: flex;
@@ -178,12 +206,8 @@ export const DEVTOOLS_PANEL_STYLES = css`
178206
box-shadow: var(--shadow-lg);
179207
position: relative;
180208
overflow-y: auto;
181-
182-
/* TODO: Remove once the content is filled. */
183-
min-width: 800px;
184-
min-height: 500px;
185-
/* This is handled from dialog/styles.ts */
186-
max-width: var(--next-dialog-max-width);
209+
width: 100%;
210+
max-height: 50vh;
187211
}
188212
189213
[data-nextjs-devtools-panel-header] {

packages/next/src/next-devtools/dev-overlay/components/errors/dev-tools-indicator/draggable.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export function Draggable({
1717
position: currentCorner,
1818
setPosition: setCurrentCorner,
1919
onDragStart,
20+
...props
2021
}: {
2122
children: React.ReactElement
2223
position: Corners
@@ -121,7 +122,7 @@ export function Draggable({
121122
}
122123

123124
return (
124-
<div ref={ref} {...drag} style={{ touchAction: 'none' }}>
125+
<div {...props} ref={ref} {...drag} style={{ touchAction: 'none' }}>
125126
{children}
126127
</div>
127128
)

0 commit comments

Comments
 (0)