2018-12-12 10:24:47 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import CommonToolbar from './common-toolbar';
|
|
|
|
import { Button } from 'reactstrap';
|
|
|
|
import { gettext } from '../../utils/constants';
|
|
|
|
|
|
|
|
const propTypes = {
|
|
|
|
searchPlaceholder: PropTypes.string,
|
|
|
|
onShowSidePanel: PropTypes.func.isRequired,
|
|
|
|
onSearchedClick: PropTypes.func.isRequired,
|
|
|
|
toggleAddGroupModal: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
class GroupsToolbar extends React.Component {
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
let { onShowSidePanel, onSearchedClick } = this.props;
|
|
|
|
return (
|
2019-02-20 03:54:25 +00:00
|
|
|
<div className="main-panel-north border-left-show">
|
|
|
|
<div className="cur-view-toolbar">
|
2018-12-12 10:24:47 +00:00
|
|
|
<div className="operation">
|
|
|
|
<Button color="btn btn-secondary operation-item" onClick={this.props.toggleAddGroupModal}>
|
2019-01-31 09:37:02 +00:00
|
|
|
<i className="fas fa-plus-square text-secondary mr-1"></i>{gettext('New Group')}
|
2018-12-12 10:24:47 +00:00
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
<span title="Side Nav Menu" onClick={onShowSidePanel}
|
|
|
|
className="sf2-icon-menu side-nav-toggle hidden-md-up d-md-none">
|
|
|
|
</span>
|
|
|
|
</div>
|
2018-12-13 07:48:42 +00:00
|
|
|
<CommonToolbar searchPlaceholder={this.props.searchPlaceholder} onSearchedClick={onSearchedClick}/>
|
2018-12-12 10:24:47 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GroupsToolbar.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default GroupsToolbar;
|