summaryrefslogtreecommitdiff
path: root/src/components/app/sidebars/Sidebar.js
diff options
context:
space:
mode:
authorGeorgios Andreadis <G.Andreadis@student.tudelft.nl>2017-10-04 23:23:09 +0200
committerGitHub <noreply@github.com>2017-10-04 23:23:09 +0200
commitfcaaae65d34003874c76e0c01134dedf94248e09 (patch)
tree2aae1422168651e832a1904623f6f5b100fc17ec /src/components/app/sidebars/Sidebar.js
parent0a62dfb55c5700013d42a589b930c7448e5bff71 (diff)
parent606d1de0be09f3597165248f65d54e158a13860c (diff)
Merge pull request #42 from atlarge-research/auto-reformat
Standardize code format
Diffstat (limited to 'src/components/app/sidebars/Sidebar.js')
-rw-r--r--src/components/app/sidebars/Sidebar.js66
1 files changed, 39 insertions, 27 deletions
diff --git a/src/components/app/sidebars/Sidebar.js b/src/components/app/sidebars/Sidebar.js
index 00e3607a..33dbe011 100644
--- a/src/components/app/sidebars/Sidebar.js
+++ b/src/components/app/sidebars/Sidebar.js
@@ -3,36 +3,48 @@ import React from "react";
import "./Sidebar.css";
class Sidebar extends React.Component {
- state = {
- collapsed: false
- };
+ state = {
+ collapsed: false
+ };
- render() {
- const collapseButton = (
- <div
- className={classNames("sidebar-collapse-button", {"sidebar-collapse-button-right": this.props.isRight})}
- onClick={() => this.setState({collapsed: !this.state.collapsed})}
- >
- {(this.state.collapsed && this.props.isRight) || (!this.state.collapsed && !this.props.isRight) ?
- <span className="fa fa-angle-left" title={this.props.isRight ? "Expand" : "Collapse"}/> :
- <span className="fa fa-angle-right" title={this.props.isRight ? "Collapse" : "Expand"}/>
- }
- </div>
- );
+ render() {
+ const collapseButton = (
+ <div
+ className={classNames("sidebar-collapse-button", {
+ "sidebar-collapse-button-right": this.props.isRight
+ })}
+ onClick={() => this.setState({ collapsed: !this.state.collapsed })}
+ >
+ {(this.state.collapsed && this.props.isRight) ||
+ (!this.state.collapsed && !this.props.isRight) ? (
+ <span
+ className="fa fa-angle-left"
+ title={this.props.isRight ? "Expand" : "Collapse"}
+ />
+ ) : (
+ <span
+ className="fa fa-angle-right"
+ title={this.props.isRight ? "Collapse" : "Expand"}
+ />
+ )}
+ </div>
+ );
- if (this.state.collapsed) {
- return collapseButton;
- }
- return (
- <div
- className={classNames("sidebar p-3 h-100", {"sidebar-right": this.props.isRight})}
- onWheel={e => e.stopPropagation()}
- >
- {this.props.children}
- {collapseButton}
- </div>
- );
+ if (this.state.collapsed) {
+ return collapseButton;
}
+ return (
+ <div
+ className={classNames("sidebar p-3 h-100", {
+ "sidebar-right": this.props.isRight
+ })}
+ onWheel={e => e.stopPropagation()}
+ >
+ {this.props.children}
+ {collapseButton}
+ </div>
+ );
+ }
}
export default Sidebar;