1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-16 16:21:48 +00:00
seahub/frontend/src/components/side-panel.js

37 lines
987 B
JavaScript
Raw Normal View History

import React from 'react';
2018-10-16 10:19:51 +00:00
import PropTypes from 'prop-types';
import Logo from './logo';
import MainSideNav from './main-side-nav';
2018-10-16 10:19:51 +00:00
const propTypes = {
isSidePanelClosed: PropTypes.bool,
currentTab: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
onCloseSidePanel: PropTypes.func,
tabItemClick: PropTypes.func,
children: PropTypes.object
2018-10-16 10:19:51 +00:00
};
class SidePanel extends React.Component {
render() {
const { children } = this.props;
return (
<div className={`side-panel ${this.props.isSidePanelClosed ? '' : 'left-zero'}`}>
<div className="side-panel-north">
<Logo onCloseSidePanel={this.props.onCloseSidePanel}/>
</div>
<div className="side-panel-center">
{children ?
children :
<MainSideNav tabItemClick={this.props.tabItemClick} currentTab={this.props.currentTab} />
}
</div>
</div>
);
}
}
2018-10-16 10:19:51 +00:00
SidePanel.propTypes = propTypes;
export default SidePanel;