diff --git a/app/src/components/Sidebar/Sidebar.tsx b/app/src/components/Sidebar/Sidebar.tsx index e63705e..f96cbbb 100644 --- a/app/src/components/Sidebar/Sidebar.tsx +++ b/app/src/components/Sidebar/Sidebar.tsx @@ -23,15 +23,16 @@ import ExpandMore from '@material-ui/icons/ExpandMore' import Clear from '@material-ui/icons/Clear' import MessageHistory from './MessageHistory' import NodeStats from './NodeStats' -const Publish = React.lazy(() => import('./Publish/Publish')) import Topic from './Topic' -const ValueRenderer = React.lazy(() => import('./ValueRenderer')) import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import { TopicViewModel } from '../../TopicViewModel' - +import { default as ReactResizeDetector } from 'react-resize-detector' const throttle = require('lodash.throttle') +const Publish = React.lazy(() => import('./Publish/Publish')) +const ValueRenderer = React.lazy(() => import('./ValueRenderer')) + interface Props { node?: q.TreeNode, actions: typeof sidebarActons, @@ -42,6 +43,7 @@ interface Props { interface State { node: q.TreeNode compareMessage?: q.Message + valueRenderWidth: number } class Sidebar extends React.Component { @@ -53,7 +55,7 @@ class Sidebar extends React.Component { constructor(props: any) { super(props) console.error('Find and fix me #state') - this.state = { node: new q.Tree() } + this.state = { node: new q.Tree(), valueRenderWidth: 300 } } public componentWillReceiveProps(nextProps: Props) { @@ -114,6 +116,7 @@ class Sidebar extends React.Component { {this.messageMetaInfo()}
Loading...
}> + @@ -143,9 +146,14 @@ class Sidebar extends React.Component { ) } + private valueRenderWidthChange = (width: number) => { + console.log(width) + this.setState({ valueRenderWidth: width }) + } + private showValueComparison = (a: any) => ( - + diff --git a/app/src/components/Sidebar/ValueRenderer.tsx b/app/src/components/Sidebar/ValueRenderer.tsx index d116183..6afa0bf 100644 --- a/app/src/components/Sidebar/ValueRenderer.tsx +++ b/app/src/components/Sidebar/ValueRenderer.tsx @@ -38,7 +38,7 @@ class ValueRenderer extends React.Component { const theme = (this.props.theme.palette.type === 'dark') ? 'monokai' : 'bright:inverted' return (