Window component for hyperterm
const HyperWindow = require('hyperterm-window');
exports.decorateTerm = (Term, { React, notify }) => {
return class extends React.Component {
render () {
const children = [React.createElement(Term, Object.assign({}, this.props, { key: 'term' }))];
// Add a custom component to be displayed in the window
const myComponent = ...;
const windowProps = Object.assign({}, this.props, {key: 'window', onClose: this.props.clearChart});
const hyperwindow = React.createElement(HyperWindow, windowProps, myComponent);
children.push(hyperwindow);
return React.createElement('div', {style: {width: '100%', height: '100%', position: 'relative'}}, children);
}
}
};
See the example for how to integrate the window with the hyperterm redux store.
width
- the width of the window in pixels. optional.height
- the height of the window in pixels. optional.onClose
- function to call when the user clicks the close buttonforegroundColor
,backgroundColor
- these should be the colors specified in the user's.hyperterm.js
, used to make the window integrate well into the terminal. If you just pass all ofthis.props
from a terminal decorator these will get set automatically (see example above).
- add
position
prop - e.g. 'UPPER_LEFT', 'BOTTOM_RIGHT', etc - add ability to drag
- add ability to resize
Pull requests welcome!