boolean debug

This commit is contained in:
Val Erastov 2017-12-18 22:06:43 -08:00
parent 1597c5f4b3
commit 334b6f46e0
3 changed files with 30 additions and 15 deletions

View file

@ -16,13 +16,18 @@
}
& .section {
& .caption {
&.closable {
cursor: pointer;
&.closable > .caption {
cursor: pointer;
& .title {
&:hover {
color: blue;
color: blue;
text-decoration: underline;
}
}
}
& .caption {
&.accent {
background-color: rgb(255, 244, 244);
font-weight: bold;

View file

@ -12,12 +12,14 @@ export default class Section extends React.PureComponent {
}
render() {
let {name, tabs, closable, defaultClosed, accent, children, captionStyles} = this.props;
let {name, tabs, closable, defaultClosed, accent, children, captionStyles, controls} = this.props;
let closed = closable && (this.state.closed || defaultClosed);
return <div className={cx('section', {closable, closed})} style={{paddingLeft: tabs}}>
<div className={cx('caption', {accent}, captionStyles)} >
{closable && <i className={'fa fa-fw fa-caret-' + (closed ? 'right': 'down')} />} {name}</div>
{children}
<span className='title'>{closable && <i className={'fa fa-caret-' + (closed ? 'right': 'down')} />} {name}</span>
<span className='control'>{controls}</span>
</div>
{children}
</div>;
}
}

View file

@ -1,18 +1,26 @@
import React from 'react';
import Section from "./section";
export default class ShellExplorer extends React.PureComponent {
render() {
let {shell} = this.props;
let faceControls = <span>
<i className='fa fa-fw fa-eye' onClick={alert}/>
<i className='fa fa-fw fa-eye-slash' onClick={alert}/>
</span>;
return <div className='shell-explorer'>
<div className='caption'>faces</div>
{shell.faces.map(face => <div>
<div className='caption'>face {face.refId}</div>
{mapIterator(face.edges, e => <div>
edge: {e.refId}
</div>)}
</div>)
}
<Section name='faces' closable>
{shell.faces.map(face => <Section name={`face ${face.refId}`} tabs='0.5em' closable defaultClosed={true} controls={faceControls}>
{mapIterator(face.edges, e => <div>
edge: {e.refId}
</div>)}
</Section>)
}
</Section>
</div>;
}
}