feat(FileExplorer): make search input always visible

This commit is contained in:
EnixCoda 2018-01-12 17:53:34 +08:00
parent 6052c6d269
commit a7806b4382
2 changed files with 33 additions and 24 deletions

View file

@ -183,16 +183,18 @@ export default class List extends preact.Component {
{nodes.length === 0 ? (
<label className={'no-results'}>No results found.</label>
) : (
nodes.map(node => (
<Node
key={node.path}
node={node}
depth={depths.get(node)}
focused={focusedNode === node}
expanded={expandedNodes.has(node)}
toggleExpand={this.toggleNodeExpand.bind(null, node)}
/>
))
<div className={'files'}>
{nodes.map(node => (
<Node
key={node.path}
node={node}
depth={depths.get(node)}
focused={focusedNode === node}
expanded={expandedNodes.has(node)}
toggleExpand={this.toggleNodeExpand.bind(null, node)}
/>
))}
</div>
)}
</div>
)

View file

@ -158,24 +158,31 @@
padding: 4px 10px;
}
/* search input */
.search-input-wrapper {
input[type='text'].form-control {
box-shadow: none;
width: 100%;
}
}
.no-results {
padding: 0px 10px;
color: #666;
}
.file-explorer {
width: 100%;
height: 100%;
overflow: auto;
outline: none;
display: flex;
flex-direction: column;
flex-wrap: nowrap;
/* search input */
.search-input-wrapper {
input[type='text'].form-control {
box-shadow: none;
width: 100%;
}
}
.no-results {
padding: 0px 10px;
color: #666;
}
.files {
flex: 1;
overflow: auto;
}
.node-item-row {
background: #fff;