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

Optimized module code (#2574)

This commit is contained in:
杨顺强
2018-11-28 12:41:49 +08:00
committed by Daniel Pan
parent 330407be0b
commit 09f32f2312
21 changed files with 120 additions and 38 deletions

View File

@@ -1,12 +1,13 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { repoID, siteRoot } from '../../utils/constants';
import { siteRoot } from '../../utils/constants';
import SearchResultItem from './search-result-item';
import editorUtilities from '../../utils/editor-utilties';
import More from '../more';
const propTypes = {
placeholder: PropTypes.string,
repoID: PropTypes.string.isRequired,
onSearchedClick: PropTypes.func.isRequired,
};
@@ -60,7 +61,7 @@ class Search extends Component {
});
return false;
}
let repoID = this.props.repoID;
let queryData = {
q: newValue,
search_repo: repoID ? repoID : 'all',
@@ -165,6 +166,7 @@ class Search extends Component {
}
onShowMore = () => {
let repoID = this.props.repoID;
let newValue = this.state.value;
let queryData = {
q: newValue,