mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-19 18:29:23 +00:00
Draft dashboard optimized (#2384)
* create a common toolbar component * optimized code * combine side-panel * add change state
This commit is contained in:
committed by
Daniel Pan
parent
7a17e908b0
commit
ba583d6efd
@@ -1,15 +1,16 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { gettext } from '../../components/constants';
|
||||
import CommonToolbar from '../../components/toolbar/common-toolbar';
|
||||
import Loading from '../../components/loading';
|
||||
import Account from '../../components/account';
|
||||
import { seafileAPI } from '../../utils/editor-utilties';
|
||||
import Notification from '../../components/notification';
|
||||
import ListView from '../../components/list-view/list-view';
|
||||
import ListMenu from '../../components/list-view/list-menu';
|
||||
|
||||
const propTypes = {
|
||||
isLoadingDraft: PropTypes.bool.isRequired,
|
||||
draftList: PropTypes.array.isRequired,
|
||||
publishDraft: PropTypes.func.isRequired,
|
||||
deleteDraft: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
class MainPanel extends React.Component {
|
||||
@@ -67,15 +68,16 @@ class MainPanel extends React.Component {
|
||||
onDeleteHandler = () => {
|
||||
this.props.deleteDraft(this.state.currentDraft);
|
||||
}
|
||||
|
||||
onSearchedClick = () => {
|
||||
//todos;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="main-panel">
|
||||
<div className="main-panel-north flex-right">
|
||||
<div className="common-toolbar">
|
||||
<Notification seafileAPI={seafileAPI}/>
|
||||
<Account />
|
||||
</div>
|
||||
<CommonToolbar onSearchedClick={this.onSearchedClick}/>
|
||||
</div>
|
||||
<div className="main-panel-center">
|
||||
<div className="panel-heading text-left">{gettext('Drafts')}</div>
|
||||
|
@@ -1,24 +0,0 @@
|
||||
import React from 'react';
|
||||
import Logo from '../../components/logo';
|
||||
import MainSideNav from '../../components/main-side-nav';
|
||||
import SideNavFooter from '../../components/side-nav-footer';
|
||||
|
||||
|
||||
class SidePanel extends React.Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="side-panel">
|
||||
<div className="side-panel-north"><Logo /></div>
|
||||
<div className="side-panel-center">
|
||||
<MainSideNav />
|
||||
</div>
|
||||
<div className="side-panel-footer">
|
||||
<SideNavFooter />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SidePanel;
|
Reference in New Issue
Block a user