diff --git a/frontend/src/components/search/search.js b/frontend/src/components/search/search.js index 8cb6e1b057..785cade189 100644 --- a/frontend/src/components/search/search.js +++ b/frontend/src/components/search/search.js @@ -6,6 +6,7 @@ import { seafileAPI } from '../../utils/seafile-api'; import { gettext, siteRoot, username } from '../../utils/constants'; import SearchResultItem from './search-result-item'; import { Utils } from '../../utils/utils'; +import { isMac } from '../../utils/extra-attributes'; import toaster from '../toast'; const propTypes = { @@ -16,6 +17,7 @@ const propTypes = { }; const PER_PAGE = 10; +const controlKey = isMac() ? '⌘' : 'Ctrl'; class Search extends Component { @@ -294,20 +296,21 @@ class Search extends Component { render() { let width = this.state.width !== 'default' ? this.state.width : ''; let style = {'width': width}; - const { searchPageUrl } = this.state; + const { searchPageUrl, isMaskShow } = this.state; + const placeholder = `${this.props.placeholder}${isMaskShow ? '' : ` (${controlKey} + f )`}`; return (
-
-
-
+
+
+
{this.state.isSearchInputShow &&
-
+
@@ -342,7 +345,7 @@ class Search extends Component { type="text" className="form-control search-input" name="query" - placeholder={this.props.placeholder} + placeholder={placeholder} style={style} value={this.state.value} onFocus={this.onFocusHandler} diff --git a/frontend/src/components/toolbar/common-toolbar.js b/frontend/src/components/toolbar/common-toolbar.js index 0dc8b46f43..9d91c56cc3 100644 --- a/frontend/src/components/toolbar/common-toolbar.js +++ b/frontend/src/components/toolbar/common-toolbar.js @@ -18,20 +18,20 @@ const propTypes = { class CommonToolbar extends React.Component { render() { - let searchPlaceholder = this.props.searchPlaceholder || gettext('Search Files'); + const { repoID, repoName } = this.props; return (
{isPro && ( )} {this.props.isLibView && !isPro && } diff --git a/frontend/src/css/search.css b/frontend/src/css/search.css index 02f5fcdbc7..310e50e5cb 100644 --- a/frontend/src/css/search.css +++ b/frontend/src/css/search.css @@ -87,7 +87,7 @@ } .search-result-container .search-result-list { - margin: 10px 0; + margin: 4px 0; padding: 0; list-style: none; } @@ -98,7 +98,7 @@ .search-result-container .search-result-item { display: flex; - padding: 0.25rem 0; + padding: 10px 0 10px 8px; font-size: 0.8125rem; cursor: pointer; margin-right: 1rem; @@ -106,7 +106,7 @@ .search-result-container .search-result-item:hover { background-color: #f0f0f0; - border-radius: 5px; + border-radius: 4px; } .search-result-item .item-img { diff --git a/frontend/src/pages/lib-content-view/lib-content-toolbar.js b/frontend/src/pages/lib-content-view/lib-content-toolbar.js index 8222a562a5..369a5b4539 100644 --- a/frontend/src/pages/lib-content-view/lib-content-toolbar.js +++ b/frontend/src/pages/lib-content-view/lib-content-toolbar.js @@ -80,7 +80,13 @@ class LibContentToolbar extends React.Component { />
- + ); } @@ -132,7 +138,13 @@ class LibContentToolbar extends React.Component { /> }
- + ); } diff --git a/frontend/src/pages/search/main-panel.js b/frontend/src/pages/search/main-panel.js index 95e24980d9..090eb131b0 100644 --- a/frontend/src/pages/search/main-panel.js +++ b/frontend/src/pages/search/main-panel.js @@ -300,7 +300,7 @@ class SearchViewPanel extends React.Component { name="query" autoComplete="off" value={this.state.q} - placeholder={gettext('Search Files')} + placeholder={gettext('Search files')} onChange={this.handleSearchInput} onKeyDown={this.handleKeyDown} /> diff --git a/frontend/src/pages/wiki/main-panel.js b/frontend/src/pages/wiki/main-panel.js index fdfc68aa23..ef9230b5d7 100644 --- a/frontend/src/pages/wiki/main-panel.js +++ b/frontend/src/pages/wiki/main-panel.js @@ -78,9 +78,7 @@ class MainPanel extends Component { render() { let { onSearchedClick } = this.props; - let searchPlaceholder = gettext('Search files in this library'); const errMessage = (
{gettext('Folder does not exist.')}
); - const isViewingFile = this.props.pathExist && !this.props.isDataLoading && this.props.isViewFile; return (
@@ -93,7 +91,7 @@ class MainPanel extends Component {
{isPro && ( - + )}
@@ -110,7 +108,7 @@ class MainPanel extends Component {
{isPro && ( - + )}