mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-24 10:21:15 +01:00
Even better layouts
This commit is contained in:
@@ -11,6 +11,8 @@ const side = { gridArea: 'side' };
|
||||
const head = { gridArea: 'head' };
|
||||
const body = { gridArea: 'body' };
|
||||
|
||||
const FLOATING_SIDEBAR_BREAKPOINT = 960;
|
||||
|
||||
export default function Workspace() {
|
||||
const windowSize = useWindowSize();
|
||||
const styles = useMemo<CSSProperties>(
|
||||
@@ -26,23 +28,17 @@ export default function Workspace() {
|
||||
|
||||
return (
|
||||
<div className="grid w-full h-full" style={styles}>
|
||||
<SidebarContainer style={side} floating={windowSize.width < 800}>
|
||||
<SidebarContainer style={side} floating={windowSize.width < FLOATING_SIDEBAR_BREAKPOINT}>
|
||||
<Sidebar />
|
||||
</SidebarContainer>
|
||||
<HeaderContainer>
|
||||
<WorkspaceHeader className="pointer-events-none" />
|
||||
</HeaderContainer>
|
||||
<BodyContainer>
|
||||
<RequestResponse />
|
||||
</BodyContainer>
|
||||
<RequestResponse style={body} vertical={windowSize.width < FLOATING_SIDEBAR_BREAKPOINT} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const BodyContainer = memo(function BodyContainer({ children }: { children: ReactNode }) {
|
||||
return <div style={body}>{children}</div>;
|
||||
});
|
||||
|
||||
const HeaderContainer = memo(function HeaderContainer({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user