//
// SPDX-License-Identifier: AGPL-3.0
-import React from 'react';
+import React, { useState } from 'react';
import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
import { Route, Switch } from "react-router";
import { ProjectPanel } from "views/project-panel/project-panel";
routes = React.createElement(React.Fragment, null, pluginConfig.centerPanelList.reduce(reduceRoutesFn, React.Children.toArray(routes.props.children)));
export const WorkbenchPanel =
- withStyles(styles)((props: WorkbenchPanelProps) =>
- <Grid container item xs className={props.classes.root}>
+ withStyles(styles)((props: WorkbenchPanelProps) =>{
+ const [isExpanded, setIsExpanded] = useState<boolean>(false)
+
+ const expandRightPanel = (): void=> {
+ const rightPanel: Element = document.getElementsByClassName('layout-pane')[1]
+ rightPanel.setAttribute('style', `width: ${isExpanded ? getSplitterInitialSize() : 100}%`)
+ setIsExpanded(!isExpanded)
+ }
+
+ return <Grid container item xs className={props.classes.root}>
{props.sessionIdleTimeout > 0 && <AutoLogout />}
<Grid container item xs className={props.classes.container}>
<SplitterLayout customClassName={props.classes.splitter} percentage={true}
<SidePanel />
</Grid>}
<Grid container item xs component="main" direction="column" className={props.classes.contentWrapper}>
+ <button onClick={expandRightPanel}>moveSplitter</button>
<Grid item xs>
{props.isNotLinking && <MainContentBar />}
</Grid>
<FedLogin />
<WebDavS3InfoDialog />
{React.createElement(React.Fragment, null, pluginConfig.dialogs)}
- </Grid>
+ </Grid>}
);