add expanding/contracting styles
This commit is contained in:
parent
e82270a709
commit
550347e6fc
4 changed files with 31 additions and 21 deletions
|
@ -1,7 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="10px" height="10px" viewBox="0 0 5 5" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 39.1 (31720) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Triangle 3</title>
|
||||
<title>Down Arrow</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
|
|
Before Width: | Height: | Size: 836 B After Width: | Height: | Size: 698 B |
|
@ -1,7 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="10px" height="10px" viewBox="0 0 5 5" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 39.1 (31720) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Triangle 3</title>
|
||||
<title>Right Arrow</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
|
|
Before Width: | Height: | Size: 835 B After Width: | Height: | Size: 698 B |
|
@ -83,23 +83,22 @@ export class FileNode extends React.Component {
|
|||
<InlineSVG src={fileUrl} />
|
||||
</span>
|
||||
);
|
||||
} else if (this.props.isFolderClosed) {
|
||||
return (
|
||||
<span
|
||||
className="sidebar__file-item-icon"
|
||||
onClick={() => this.props.showFolderChildren(this.props.id)}
|
||||
>
|
||||
<InlineSVG src={folderRightUrl} />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<span
|
||||
className="sidebar__file-item-icon"
|
||||
className="sidebar__file-item-closed"
|
||||
onClick={() => this.props.showFolderChildren(this.props.id)}
|
||||
>
|
||||
<InlineSVG className="folder-right" src={folderRightUrl} />
|
||||
</span>
|
||||
<span
|
||||
className="sidebar__file-item-open"
|
||||
onClick={() => this.props.hideFolderChildren(this.props.id)}
|
||||
>
|
||||
<InlineSVG src={folderDownUrl} />
|
||||
<InlineSVG className="folder-down" src={folderDownUrl} />
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
<a className="sidebar__file-item-name">{this.props.name}</a>
|
||||
|
|
|
@ -166,6 +166,21 @@
|
|||
margin-right: #{5 / $base-font-size}rem;
|
||||
}
|
||||
|
||||
.sidebar__file-item-closed {
|
||||
@extend .sidebar__file-item-icon;
|
||||
display: none;
|
||||
.sidebar__file-item--closed & {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar__file-item-open {
|
||||
@extend .sidebar__file-item-icon;
|
||||
.sidebar__file-item--closed & {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.sidebar__project-options {
|
||||
@extend %modal;
|
||||
display: none;
|
||||
|
|
Loading…
Reference in a new issue