UI changes
This commit is contained in:
parent
0aba73a2a3
commit
8616837c01
13 changed files with 126 additions and 100 deletions
|
|
@ -24,10 +24,11 @@ export function usePaneResize(
|
|||
const handlePointerMove = useCallback(
|
||||
(e: React.PointerEvent) => {
|
||||
if (!draggingRef.current) return;
|
||||
const resolvedMax = maxWidth <= 1 ? window.innerWidth * maxWidth : maxWidth;
|
||||
const newWidth =
|
||||
side === 'left'
|
||||
? Math.min(maxWidth, Math.max(minWidth, e.clientX))
|
||||
: Math.min(maxWidth, Math.max(minWidth, window.innerWidth - e.clientX));
|
||||
? Math.min(resolvedMax, Math.max(minWidth, e.clientX))
|
||||
: Math.min(resolvedMax, Math.max(minWidth, window.innerWidth - e.clientX));
|
||||
setWidth(newWidth);
|
||||
},
|
||||
[side, minWidth, maxWidth]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue