2019-04-17 18:57:46 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import SearchBar from './SearchBar';
|
2019-06-10 16:22:35 +00:00
|
|
|
import Directory from './Directory';
|
2019-04-17 18:57:46 +00:00
|
|
|
import Sort from './Sort';
|
|
|
|
|
|
|
|
const ListHeader = React.memo(({
|
2019-11-25 20:01:17 +00:00
|
|
|
searchLength, sortBy, onChangeSearchText, toggleSort, goDirectory, inputRef
|
2019-04-17 18:57:46 +00:00
|
|
|
}) => (
|
2019-09-24 20:26:56 +00:00
|
|
|
<>
|
2019-11-25 20:01:17 +00:00
|
|
|
<SearchBar onChangeSearchText={onChangeSearchText} inputRef={inputRef} />
|
2019-06-10 16:22:35 +00:00
|
|
|
<Directory goDirectory={goDirectory} />
|
2019-04-17 18:57:46 +00:00
|
|
|
<Sort searchLength={searchLength} sortBy={sortBy} toggleSort={toggleSort} />
|
2019-09-24 20:26:56 +00:00
|
|
|
</>
|
2019-04-17 18:57:46 +00:00
|
|
|
));
|
|
|
|
|
|
|
|
ListHeader.propTypes = {
|
|
|
|
searchLength: PropTypes.number,
|
|
|
|
sortBy: PropTypes.string,
|
|
|
|
onChangeSearchText: PropTypes.func,
|
2019-06-10 16:22:35 +00:00
|
|
|
toggleSort: PropTypes.func,
|
2019-11-25 20:01:17 +00:00
|
|
|
goDirectory: PropTypes.func,
|
|
|
|
inputRef: PropTypes.func
|
2019-04-17 18:57:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ListHeader;
|