mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-10-30 14:49:14 +00:00
23 lines
624 B
TypeScript
23 lines
624 B
TypeScript
import {LayoutKey} from 'sentry/utils/replays/hooks/useReplayLayout';
|
|
import theme from 'sentry/utils/theme';
|
|
|
|
export const getDefaultLayout = (collapsed: boolean): LayoutKey => {
|
|
const {innerWidth, innerHeight} = window;
|
|
|
|
const sidebarWidth = parseInt(
|
|
collapsed ? theme.sidebar.collapsedWidth : theme.sidebar.expandedWidth,
|
|
10
|
|
);
|
|
|
|
const mediumScreenWidth = parseInt(theme.breakpoints.medium, 10);
|
|
|
|
const windowsWidth =
|
|
innerWidth <= mediumScreenWidth ? innerWidth : innerWidth - sidebarWidth;
|
|
|
|
if (windowsWidth < innerHeight) {
|
|
return LayoutKey.TOPBAR;
|
|
}
|
|
|
|
return LayoutKey.SIDEBAR_LEFT;
|
|
};
|