committed by
GitHub
co-authored by
Konstantin Zolin
parent
d587ed7542
commit
51c4ec693b
@@ -276,23 +276,23 @@ export const MainLayout: React.FC = () => {
|
|||||||
const width = window.innerWidth;
|
const width = window.innerWidth;
|
||||||
const height = window.innerHeight;
|
const height = window.innerHeight;
|
||||||
|
|
||||||
const shouldCloseRightSidebar = width < RIGHT_SIDEBAR_AUTO_CLOSE_WIDTH;
|
|
||||||
const canAutoOpenRightSidebar = width >= RIGHT_SIDEBAR_AUTO_OPEN_WIDTH;
|
|
||||||
|
|
||||||
if (shouldCloseRightSidebar) {
|
|
||||||
if (state.isRightSidebarOpen) {
|
|
||||||
setRightSidebarOpen(false);
|
|
||||||
rightSidebarAutoClosedRef.current = true;
|
|
||||||
}
|
|
||||||
} else if (canAutoOpenRightSidebar && rightSidebarAutoClosedRef.current) {
|
|
||||||
setRightSidebarOpen(true);
|
|
||||||
rightSidebarAutoClosedRef.current = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Touch devices frequently resize when the on-screen keyboard opens.
|
// Touch devices frequently resize when the on-screen keyboard opens.
|
||||||
// Treat bottom-terminal auto-collapse/restore as desktop-only so
|
// Treat panel auto-collapse/restore as desktop-only so keyboard
|
||||||
// keyboard viewport changes do not churn terminal layout state.
|
// viewport changes do not churn drawer or terminal layout state.
|
||||||
if (!isMobile && !isTablet) {
|
if (!isMobile && !isTablet) {
|
||||||
|
const shouldCloseRightSidebar = width < RIGHT_SIDEBAR_AUTO_CLOSE_WIDTH;
|
||||||
|
const canAutoOpenRightSidebar = width >= RIGHT_SIDEBAR_AUTO_OPEN_WIDTH;
|
||||||
|
|
||||||
|
if (shouldCloseRightSidebar) {
|
||||||
|
if (state.isRightSidebarOpen) {
|
||||||
|
setRightSidebarOpen(false);
|
||||||
|
rightSidebarAutoClosedRef.current = true;
|
||||||
|
}
|
||||||
|
} else if (canAutoOpenRightSidebar && rightSidebarAutoClosedRef.current) {
|
||||||
|
setRightSidebarOpen(true);
|
||||||
|
rightSidebarAutoClosedRef.current = false;
|
||||||
|
}
|
||||||
|
|
||||||
const shouldCloseBottomTerminal =
|
const shouldCloseBottomTerminal =
|
||||||
height < BOTTOM_TERMINAL_AUTO_CLOSE_HEIGHT;
|
height < BOTTOM_TERMINAL_AUTO_CLOSE_HEIGHT;
|
||||||
const canAutoOpenBottomTerminal =
|
const canAutoOpenBottomTerminal =
|
||||||
|
|||||||
Reference in New Issue
Block a user