Show monitor when isVisible is true

This commit is contained in:
Patrick Burtchaell 2015-07-19 10:21:53 -05:00
parent 2a103c005a
commit daf029fca2
2 changed files with 49 additions and 38 deletions

View File

@ -17,7 +17,6 @@ export function getDefaultStyle(props) {
opacity: 0.92,
background: 'black',
color: 'white',
padding: '1em',
left: left ? 0 : undefined,
right: right ? 0 : undefined,
top: top ? 0 : undefined,

View File

@ -105,47 +105,59 @@ export default class LogMonitor {
);
}
return (
<div style={{
fontFamily: 'monospace',
position: 'relative'
}}>
<div>
<a onClick={::this.handleReset}
style={{ textDecoration: 'underline', cursor: 'hand' }}>
Reset
</a>
</div>
{elements}
<div>
{computedStates.length > 1 &&
<a onClick={::this.handleRollback}
style={{ textDecoration: 'underline', cursor: 'hand' }}>
Rollback
</a>
}
{Object.keys(skippedActions).some(key => skippedActions[key]) &&
<span>
{' • '}
<a onClick={::this.handleSweep}
if (this.props.monitorState.isVisible === true) {
return (
<div style={{
fontFamily: 'monospace',
position: 'relative',
padding: '1rem'
}}>
<div>
<div style={{
paddingBottom: '.5rem'
}}>
<small>Press `ctl+h` to hide.</small>
</div>
<div>
<a onClick={::this.handleReset}
style={{ textDecoration: 'underline', cursor: 'hand' }}>
Sweep
<small>Reset</small>
</a>
</span>
}
{computedStates.length > 1 &&
<span>
</div>
</div>
{elements}
<div>
{computedStates.length > 1 &&
<a onClick={::this.handleRollback}
style={{ textDecoration: 'underline', cursor: 'hand' }}>
Rollback
</a>
}
{Object.keys(skippedActions).some(key => skippedActions[key]) &&
<span>
{' • '}
{' • '}
<a onClick={::this.handleSweep}
style={{ textDecoration: 'underline', cursor: 'hand' }}>
Sweep
</a>
</span>
<a onClick={::this.handleCommit}
style={{ textDecoration: 'underline', cursor: 'hand' }}>
Commit
</a>
</span>
}
}
{computedStates.length > 1 &&
<span>
<span>
{' • '}
</span>
<a onClick={::this.handleCommit}
style={{ textDecoration: 'underline', cursor: 'hand' }}>
Commit
</a>
</span>
}
</div>
</div>
</div>
);
);
}
return false;
}
}