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(({
|
2020-02-19 19:43:47 +00:00
|
|
|
searching,
|
|
|
|
sortBy,
|
|
|
|
onChangeSearchText,
|
|
|
|
toggleSort,
|
|
|
|
goDirectory,
|
|
|
|
inputRef,
|
|
|
|
onCancelSearchPress,
|
|
|
|
onSearchFocus
|
2019-04-17 18:57:46 +00:00
|
|
|
}) => (
|
2019-10-07 20:56:30 +00:00
|
|
|
<>
|
2020-02-19 19:43:47 +00:00
|
|
|
<SearchBar
|
|
|
|
inputRef={inputRef}
|
|
|
|
searching={searching}
|
|
|
|
onChangeSearchText={onChangeSearchText}
|
|
|
|
onCancelSearchPress={onCancelSearchPress}
|
|
|
|
onSearchFocus={onSearchFocus}
|
|
|
|
/>
|
|
|
|
<Directory searching={searching} goDirectory={goDirectory} />
|
|
|
|
<Sort searching={searching} sortBy={sortBy} toggleSort={toggleSort} />
|
2019-10-07 20:56:30 +00:00
|
|
|
</>
|
2019-04-17 18:57:46 +00:00
|
|
|
));
|
|
|
|
|
|
|
|
ListHeader.propTypes = {
|
2020-02-19 19:43:47 +00:00
|
|
|
searching: PropTypes.bool,
|
2019-04-17 18:57:46 +00:00
|
|
|
sortBy: PropTypes.string,
|
|
|
|
onChangeSearchText: PropTypes.func,
|
2019-06-10 16:22:35 +00:00
|
|
|
toggleSort: PropTypes.func,
|
2019-12-11 23:01:12 +00:00
|
|
|
goDirectory: PropTypes.func,
|
2020-02-19 19:43:47 +00:00
|
|
|
inputRef: PropTypes.func,
|
|
|
|
onCancelSearchPress: PropTypes.func,
|
|
|
|
onSearchFocus: PropTypes.func
|
2019-04-17 18:57:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ListHeader;
|