feat: added default close option to viewer layout for sidebar ui (#2961)
This commit is contained in:
parent
06feca1f4a
commit
1bcc9ccd89
@ -86,6 +86,8 @@ function ViewerLayout({
|
|||||||
// From Modes
|
// From Modes
|
||||||
leftPanels,
|
leftPanels,
|
||||||
rightPanels,
|
rightPanels,
|
||||||
|
leftPanelDefaultClosed,
|
||||||
|
rightPanelDefaultClosed,
|
||||||
viewports,
|
viewports,
|
||||||
ViewportGridComp,
|
ViewportGridComp,
|
||||||
}) {
|
}) {
|
||||||
@ -209,7 +211,9 @@ function ViewerLayout({
|
|||||||
<ErrorBoundary context="Left Panel">
|
<ErrorBoundary context="Left Panel">
|
||||||
<SidePanel
|
<SidePanel
|
||||||
side="left"
|
side="left"
|
||||||
defaultComponentOpen={leftPanelComponents[0].name}
|
defaultComponentOpen={
|
||||||
|
leftPanelDefaultClosed ? null : leftPanelComponents[0].name
|
||||||
|
}
|
||||||
childComponents={leftPanelComponents}
|
childComponents={leftPanelComponents}
|
||||||
/>
|
/>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
@ -230,7 +234,9 @@ function ViewerLayout({
|
|||||||
<ErrorBoundary context="Right Panel">
|
<ErrorBoundary context="Right Panel">
|
||||||
<SidePanel
|
<SidePanel
|
||||||
side="right"
|
side="right"
|
||||||
defaultComponentOpen={rightPanelComponents[0].name}
|
defaultComponentOpen={
|
||||||
|
rightPanelDefaultClosed ? null : rightPanelComponents[0].name
|
||||||
|
}
|
||||||
childComponents={rightPanelComponents}
|
childComponents={rightPanelComponents}
|
||||||
/>
|
/>
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
@ -249,6 +255,8 @@ ViewerLayout.propTypes = {
|
|||||||
// From modes
|
// From modes
|
||||||
leftPanels: PropTypes.array,
|
leftPanels: PropTypes.array,
|
||||||
rightPanels: PropTypes.array,
|
rightPanels: PropTypes.array,
|
||||||
|
leftPanelDefaultClosed: PropTypes.bool.isRequired,
|
||||||
|
rightPanelDefaultClosed: PropTypes.bool.isRequired,
|
||||||
/** Responsible for rendering our grid of viewports; provided by consuming application */
|
/** Responsible for rendering our grid of viewports; provided by consuming application */
|
||||||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
children: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
|
||||||
};
|
};
|
||||||
@ -256,6 +264,8 @@ ViewerLayout.propTypes = {
|
|||||||
ViewerLayout.defaultProps = {
|
ViewerLayout.defaultProps = {
|
||||||
leftPanels: [],
|
leftPanels: [],
|
||||||
rightPanels: [],
|
rightPanels: [],
|
||||||
|
leftPanelDefaultClosed: false,
|
||||||
|
rightPanelDefaultClosed: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ViewerLayout;
|
export default ViewerLayout;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user