Unverified Commit 437f0c16 authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

[devtools] panel ui responsiveness (#80732)

https://github.com/user-attachments/assets/a15165f2-e340-4ec6-a3e1-a895bfac1531



Closes NEXT-4548
parent 92561090
...@@ -72,6 +72,7 @@ export function DevToolsPanel({ ...@@ -72,6 +72,7 @@ export function DevToolsPanel({
onClick={onCloseDevToolsPanel} onClick={onCloseDevToolsPanel}
/> />
<Draggable <Draggable
data-nextjs-devtools-panel-draggable
padding={INDICATOR_PADDING} padding={INDICATOR_PADDING}
onDragStart={() => {}} onDragStart={() => {}}
position={state.devToolsPosition} position={state.devToolsPosition}
...@@ -160,6 +161,23 @@ export const DEVTOOLS_PANEL_STYLES = css` ...@@ -160,6 +161,23 @@ export const DEVTOOLS_PANEL_STYLES = css`
margin: auto; margin: auto;
/* TODO: This is for fullscreen mode. */ /* TODO: This is for fullscreen mode. */
/* top: 10vh; */ /* top: 10vh; */
@media (max-width: 575px) {
left: 20px !important;
right: 20px !important;
}
@media (min-width: 576px) {
max-width: 540px;
}
@media (min-width: 768px) {
max-width: 720px;
}
@media (min-width: 992px) {
max-width: 960px;
}
} }
[data-nextjs-devtools-panel-overlay-backdrop] { [data-nextjs-devtools-panel-overlay-backdrop] {
...@@ -167,6 +185,11 @@ export const DEVTOOLS_PANEL_STYLES = css` ...@@ -167,6 +185,11 @@ export const DEVTOOLS_PANEL_STYLES = css`
opacity: 0; opacity: 0;
} }
[data-nextjs-devtools-panel-draggable] {
/* For responsiveness */
width: 100%;
}
[data-nextjs-devtools-panel-dialog] { [data-nextjs-devtools-panel-dialog] {
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
display: flex; display: flex;
...@@ -178,12 +201,9 @@ export const DEVTOOLS_PANEL_STYLES = css` ...@@ -178,12 +201,9 @@ export const DEVTOOLS_PANEL_STYLES = css`
box-shadow: var(--shadow-lg); box-shadow: var(--shadow-lg);
position: relative; position: relative;
overflow-y: auto; overflow-y: auto;
width: 100%;
/* TODO: Remove once the content is filled. */ max-height: 50vh;
min-width: 800px; min-height: 450px;
min-height: 500px;
/* This is handled from dialog/styles.ts */
max-width: var(--next-dialog-max-width);
} }
[data-nextjs-devtools-panel-header] { [data-nextjs-devtools-panel-header] {
......
...@@ -17,6 +17,7 @@ export function Draggable({ ...@@ -17,6 +17,7 @@ export function Draggable({
position: currentCorner, position: currentCorner,
setPosition: setCurrentCorner, setPosition: setCurrentCorner,
onDragStart, onDragStart,
...props
}: { }: {
children: React.ReactElement children: React.ReactElement
position: Corners position: Corners
...@@ -121,7 +122,7 @@ export function Draggable({ ...@@ -121,7 +122,7 @@ export function Draggable({
} }
return ( return (
<div ref={ref} {...drag} style={{ touchAction: 'none' }}> <div {...props} ref={ref} {...drag} style={{ touchAction: 'none' }}>
{children} {children}
</div> </div>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment