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

View File

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