import classNames from "classnames"; import React from "react"; import "./Sidebar.css"; class Sidebar extends React.Component { state = { collapsed: false }; render() { const collapseButton = (
this.setState({ collapsed: !this.state.collapsed })} > {(this.state.collapsed && this.props.isRight) || (!this.state.collapsed && !this.props.isRight) ? ( ) : ( )}
); if (this.state.collapsed) { return collapseButton; } return (
e.stopPropagation()} > {this.props.children} {collapseButton}
); } } export default Sidebar;