2018-09-19 21:19:11 -05:00
|
|
|
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 = {
|
2018-09-25 09:13:06 +08:00
|
|
|
onSearchedClick: PropTypes.func.isRequired,
|
|
|
|
searchPlaceholder: PropTypes.string
|
2018-09-19 21:19:11 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
class CommonToolbar extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="common-toolbar">
|
2018-09-25 09:13:06 +08:00
|
|
|
{isPro && <Search onSearchedClick={this.props.onSearchedClick} placeholder={gettext(this.props.searchPlaceholder)}/>}
|
2018-09-19 21:19:11 -05:00
|
|
|
<Notification />
|
|
|
|
<Account />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
CommonToolbar.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default CommonToolbar;
|