Skip to content

Commit

Permalink
adds resizeable container to right nav
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
  • Loading branch information
ashwin-pc committed Sep 7, 2022
1 parent b49ba63 commit 3b6c3d3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
13 changes: 11 additions & 2 deletions src/plugins/wizard/public/application/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@
padding: 0;
display: grid;
grid-template:
"topNav topNav topNav" min-content
"leftNav workspace rightNav" 1fr / #{$wizLeftNavWidth} 1fr #{$wizRightNavWidth};
"topNav topNav" min-content
"leftNav workspaceNav" 1fr / #{$wizLeftNavWidth} 1fr;
height: calc(100vh - #{$osdHeaderOffset});

&__resizeContainer {
min-height: 0;
background-color: $euiColorEmptyShade;
}

&__resizeButton {
transform: translateX(-$euiSizeM / 2);
}
}

.headerIsExpanded .wizLayout {
Expand Down
35 changes: 32 additions & 3 deletions src/plugins/wizard/public/application/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React from 'react';
import { I18nProvider } from '@osd/i18n/react';
import { EuiPage } from '@elastic/eui';
import { EuiPage, EuiResizableContainer } from '@elastic/eui';
import { DragDropProvider } from './utils/drag_drop/drag_drop_context';
import { LeftNav } from './components/left_nav';
import { TopNav } from './components/top_nav';
Expand All @@ -21,8 +21,37 @@ export const WizardApp = () => {
<EuiPage className="wizLayout">
<TopNav />
<LeftNav />
<Workspace />
<RightNav />
<EuiResizableContainer className="wizLayout__resizeContainer">
{(EuiResizablePanel, EuiResizableButton) => (
<>
<EuiResizablePanel
className="wizLayout__workspaceResize"
paddingSize="none"
initialSize={80}
minSize="300px"
mode="main"
>
<Workspace />
</EuiResizablePanel>
<EuiResizableButton className="wizLayout__resizeButton" />
<EuiResizablePanel
className="wizLayout__rightNavResize"
paddingSize="none"
initialSize={20}
minSize="250px"
mode={[
'collapsible',
{
position: 'top',
},
]}
id="wizRightResize"
>
<RightNav />
</EuiResizablePanel>
</>
)}
</EuiResizableContainer>
</EuiPage>
</DragDropProvider>
</I18nProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
&.right {
border-left: $euiBorderThin;
grid-area: rightNav;
height: 100%;
}

&__header {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
grid-gap: $euiSizeM;
padding: $euiSizeM;
background-color: $euiColorEmptyShade;
height: 100%;

&__empty {
height: 100%;
Expand Down

0 comments on commit 3b6c3d3

Please sign in to comment.