1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

search file by name (#4713)

* search file by name

* [for non-pro] redesigned 'search files in a library'

* improvement

Co-authored-by: lian <lian@seafile.com>
Co-authored-by: llj <lingjun.li1@gmail.com>
This commit is contained in:
lian
2020-11-16 10:45:19 +08:00
committed by GitHub
parent 1efd1fe4fe
commit 5ec3928d90
7 changed files with 287 additions and 3 deletions

View File

@@ -2,17 +2,21 @@ import React from 'react';
import PropTypes from 'prop-types';
import { isPro, gettext, showLogoutIcon } from '../../utils/constants';
import Search from '../search/search';
import SearchByName from '../search/search-by-name';
import Notification from '../common/notification';
import Account from '../common/account';
import Logout from '../common/logout';
const propTypes = {
repoID: PropTypes.string,
repoName: PropTypes.string,
isLibView: PropTypes.bool,
onSearchedClick: PropTypes.func.isRequired,
searchPlaceholder: PropTypes.string
};
class CommonToolbar extends React.Component {
class CommonToolbar extends React.Component {
render() {
let searchPlaceholder = this.props.searchPlaceholder || gettext('Search Files');
return (
@@ -24,6 +28,12 @@ class CommonToolbar extends React.Component {
onSearchedClick={this.props.onSearchedClick}
/>
)}
{this.props.isLibView && !isPro &&
<SearchByName
repoID={this.props.repoID}
repoName={this.props.repoName}
/>
}
<Notification />
<Account />
{showLogoutIcon && (<Logout />)}