mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-08 02:10:24 +00:00
Draft optimized (#2409)
* repair drafts * repair naming error * optimized code * sentence error
This commit is contained in:
committed by
Daniel Pan
parent
3273900056
commit
5cffd4cb69
33
frontend/src/components/draft-list-view/draft-list-menu.js
Normal file
33
frontend/src/components/draft-list-view/draft-list-menu.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { gettext } from '../constants';
|
||||
|
||||
const propTypes = {
|
||||
isMenuShow: PropTypes.bool.isRequired,
|
||||
menuPosition: PropTypes.object.isRequired,
|
||||
onDeleteHandler: PropTypes.func.isRequired,
|
||||
onPublishHandler: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
class DraftListMenu extends React.Component {
|
||||
|
||||
render() {
|
||||
let style = '';
|
||||
let {isMenuShow, menuPosition} = this.props;
|
||||
if (isMenuShow) {
|
||||
style = {position: 'fixed', top: menuPosition.top, left: menuPosition.left, display: 'block'}
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<ul className="dropdown-menu" style={style}>
|
||||
<li className="dropdown-item" onClick={this.props.onDeleteHandler}>{gettext('Delete')}</li>
|
||||
<li className="dropdown-item" onClick={this.props.onPublishHandler}>{gettext('Publish')}</li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
DraftListMenu.propTypes = propTypes;
|
||||
|
||||
export default DraftListMenu;
|
Reference in New Issue
Block a user