mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-05 08:53:14 +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
26
frontend/src/components/toolbar/common-toolbar.js
Normal file
26
frontend/src/components/toolbar/common-toolbar.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { isPro, gettext } from '../../components/constants';
|
||||
import Search from '../search/search';
|
||||
import Notification from '../common/notification';
|
||||
import Account from '../common/account';
|
||||
|
||||
const propTypes = {
|
||||
onSearchedClick: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
class CommonToolbar extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="common-toolbar">
|
||||
{isPro && <Search onSearchedClick={this.props.onSearchedClick} placeholder={gettext("Search files")}/>}
|
||||
<Notification />
|
||||
<Account />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
CommonToolbar.propTypes = propTypes;
|
||||
|
||||
export default CommonToolbar;
|
Reference in New Issue
Block a user