From 550347e6fce4734e13d06128c4f42aef8f2153dd Mon Sep 17 00:00:00 2001 From: catarak Date: Tue, 30 Aug 2016 21:08:50 -0400 Subject: [PATCH] add expanding/contracting styles --- client/images/triangle-arrow-down.svg | 4 +--- client/images/triangle-arrow-right.svg | 4 +--- client/modules/IDE/components/FileNode.js | 29 +++++++++++------------ client/styles/components/_sidebar.scss | 15 ++++++++++++ 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/client/images/triangle-arrow-down.svg b/client/images/triangle-arrow-down.svg index fec407e0..a66e9ff6 100644 --- a/client/images/triangle-arrow-down.svg +++ b/client/images/triangle-arrow-down.svg @@ -1,7 +1,5 @@ - - - Triangle 3 + Down Arrow Created with Sketch. diff --git a/client/images/triangle-arrow-right.svg b/client/images/triangle-arrow-right.svg index 8261d814..a99148b2 100644 --- a/client/images/triangle-arrow-right.svg +++ b/client/images/triangle-arrow-right.svg @@ -1,7 +1,5 @@ - - - Triangle 3 + Right Arrow Created with Sketch. diff --git a/client/modules/IDE/components/FileNode.js b/client/modules/IDE/components/FileNode.js index ed481706..a08f7bbe 100644 --- a/client/modules/IDE/components/FileNode.js +++ b/client/modules/IDE/components/FileNode.js @@ -83,23 +83,22 @@ export class FileNode extends React.Component { ); - } else if (this.props.isFolderClosed) { - return ( - this.props.showFolderChildren(this.props.id)} - > - - - ); } return ( - this.props.hideFolderChildren(this.props.id)} - > - - +
+ this.props.showFolderChildren(this.props.id)} + > + + + this.props.hideFolderChildren(this.props.id)} + > + + +
); })()} {this.props.name} diff --git a/client/styles/components/_sidebar.scss b/client/styles/components/_sidebar.scss index 030d4034..bea88324 100644 --- a/client/styles/components/_sidebar.scss +++ b/client/styles/components/_sidebar.scss @@ -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;