diff --git a/src/LogMonitor.js b/src/LogMonitor.js index c760b92..d7ec84e 100644 --- a/src/LogMonitor.js +++ b/src/LogMonitor.js @@ -48,6 +48,9 @@ export default class LogMonitor extends Component { actionsById: PropTypes.object, stagedActionIds: PropTypes.array, skippedActionIds: PropTypes.array, + density: PropTypes.oneOf(['comfortable', + 'cozy', + 'compact']), monitorState: PropTypes.shape({ initialScrollTop: PropTypes.number }), @@ -197,6 +200,7 @@ export default class LogMonitor extends Component { state={state} previousState={previousState} collapsed={skippedActionIds.indexOf(actionId) > -1} + density={this.props.density} error={error} expandActionRoot={this.props.expandActionRoot} expandStateRoot={this.props.expandStateRoot} diff --git a/src/LogMonitorEntry.js b/src/LogMonitorEntry.js index 1188b0a..d720203 100644 --- a/src/LogMonitorEntry.js +++ b/src/LogMonitorEntry.js @@ -19,6 +19,9 @@ export default class LogMonitorEntry extends Component { action: PropTypes.object.isRequired, actionId: PropTypes.number.isRequired, select: PropTypes.func.isRequired, + density: PropTypes.oneOf(['comfortable', + 'cozy', + 'compact']), error: PropTypes.string, onActionClick: PropTypes.func.isRequired, collapsed: PropTypes.bool, @@ -33,6 +36,15 @@ export default class LogMonitorEntry extends Component { this.handleActionClick = this.handleActionClick.bind(this); } + addDensity(style) { + const { density } = this.props + switch(density) { + case 'compact': + style.marginTop = 0 + } + return style + } + printState(state, error) { let errorText = error; if (!errorText) { @@ -48,7 +60,7 @@ export default class LogMonitorEntry extends Component { undefined } expandRoot={this.props.expandStateRoot} - style={styles.tree} /> + style={this.addDensity(styles.tree)} /> ); } catch (err) { errorText = 'Error selecting state.'; @@ -93,6 +105,7 @@ export default class LogMonitorEntry extends Component { action={action} expandActionRoot={this.props.expandActionRoot} onClick={this.handleActionClick} + density={this.props.density} style={{...styles.entry, ...styleEntry}}/> {!collapsed &&