Fix resize observer

This commit is contained in:
Gregory Schier
2024-01-15 12:02:08 -08:00
parent 34a8fc4e22
commit 4df7356950
3 changed files with 5 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ const drag = { gridArea: 'drag' };
const DEFAULT = 0.5;
const MIN_WIDTH_PX = 10;
const MIN_HEIGHT_PX = 30;
const STACK_VERTICAL_WIDTH = 600;
const STACK_VERTICAL_WIDTH = 700;
export const RequestResponse = memo(function RequestResponse({ style }: Props) {
const containerRef = useRef<HTMLDivElement>(null);
@@ -37,9 +37,8 @@ export const RequestResponse = memo(function RequestResponse({ style }: Props) {
null,
);
useResizeObserver(containerRef, ({ contentRect }) => {
const doIt = contentRect.width < STACK_VERTICAL_WIDTH;
setVertical(doIt);
useResizeObserver(containerRef.current, ({ contentRect }) => {
setVertical(contentRect.width < STACK_VERTICAL_WIDTH);
});
const styles = useMemo<CSSProperties>(

View File

@@ -109,7 +109,7 @@ export function SettingsDropdown() {
},
]}
>
<IconButton size="sm" title="Main Menu" icon="hamburger" className="pointer-events-auto" />
<IconButton size="sm" title="Main Menu" icon="gear" className="pointer-events-auto" />
</Dropdown>
);
}

View File

@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "ESNext",
"target": "es2021",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,