summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-25 14:53:54 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-25 14:53:54 +0200
commitaa9b32f8cd1467e9718959f400f6777e5d71737d (patch)
treeb88bbede15108c6855d7f94ded4c7054df186a72 /opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js
parenteb0e0a3bc557c05a70eead388797ab850ea87366 (diff)
parentb7a71e5b4aa77b41ef41deec2ace42b67a5a13a7 (diff)
merge: Integrate v2.1 progress into public repository
This pull request integrates the changes planned for the v2.1 release of OpenDC into the public Github repository in order to sync the progress of both repositories.
Diffstat (limited to 'opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js')
-rw-r--r--opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js b/opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js
deleted file mode 100644
index f7368f54..00000000
--- a/opendc-web/opendc-web-ui/src/components/app/sidebars/Sidebar.js
+++ /dev/null
@@ -1,53 +0,0 @@
-import PropTypes from 'prop-types'
-import classNames from 'classnames'
-import React from 'react'
-import './Sidebar.sass'
-
-class Sidebar extends React.Component {
- static propTypes = {
- isRight: PropTypes.bool.isRequired,
- collapsible: PropTypes.bool,
- }
-
- static defaultProps = {
- collapsible: true,
- }
-
- 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>
- )
-
- 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}
- {this.props.collapsible && collapseButton}
- </div>
- )
- }
-}
-
-export default Sidebar