This commit is contained in:
Jan Prochazka 2020-11-05 14:38:01 +01:00
parent 399d194771
commit dfc8c75d76
2 changed files with 6 additions and 7 deletions

View File

@ -54,17 +54,16 @@ export default function WidgetColumnBar({ children }) {
{childArray.map((widget, index) => {
if (!widget) return null;
return (
<>
<React.Fragment key={widget.props.name}>
<WidgetTitle onClick={() => toggleCollapsed(widget.props.name)}>{widget.props.title}</WidgetTitle>
<WidgetContainer
parentHeight={dimensions && dimensions.height}
visible={!collapsedWidgets.includes(widget.props.name)}
widget={widget}
key={widget.props.name}
initialSize={widget.props.height}
splitterVisible={!!childArray.slice(index + 1).find((x) => x && !collapsedWidgets.includes(x.props.name))}
/>
</>
</React.Fragment>
);
})}
</WidgetsMainContainer>

View File

@ -1,7 +1,7 @@
// @ts-nocheck
import React from 'react';
import styled from 'styled-components';
import theme from '../theme';
// import theme from '../theme';
import { useLeftPanelWidth } from '../utility/globalState';
export const SearchBoxWrapper = styled.div`
@ -20,18 +20,18 @@ export const WidgetsMainContainer = styled.div`
const StyledWidgetsOuterContainer = styled.div`
overflow: hidden;
width: ${(props) => props.leftPanelWidth}px;
// width: ${(props) => props.leftPanelWidth}px;
position: relative;
flex-direction: column;
display: flex;
`;
export function WidgetsOuterContainer({ children, style = undefined, refNode = undefined }) {
const leftPanelWidth = useLeftPanelWidth();
// const leftPanelWidth = useLeftPanelWidth();
return (
<StyledWidgetsOuterContainer
ref={refNode}
leftPanelWidth={leftPanelWidth}
// leftPanelWidth={leftPanelWidth}
style={{
...style,
flex: style && (style.height != null || style.width != null) ? undefined : '1 1 0',