import React, { PropTypes } from 'react'; import { createSelector } from 'reselect'; import { connect } from 'react-redux'; import PureComponent from 'react-pure-render/component'; import { Col, Row } from 'react-bootstrap'; import TestSuite from './Test-Suite.jsx'; import Output from './Output.jsx'; import ToolPanel from './Tool-Panel.jsx'; const mapStateToProps = createSelector( state => state.app.windowHeight, state => state.app.navHeight, (windowHeight, navHeight) => ({ height: windowHeight - navHeight - 50 }) ); export class SidePanel extends PureComponent { constructor(...args) { super(...args); this.descriptionRegex = /\ { if (descriptionRegex.test(line)) { return (
); } return (

); }); } render() { const { title, description, height } = this.props; const style = { overflowX: 'hidden', overflowY: 'auto' }; if (height) { style.height = height + 'px'; } return (

{ title }


{ this.renderDescription(description, this.descriptionRegex) }

); } } export default connect(mapStateToProps)(SidePanel);