Rocket.Chat.ReactNative/app/views/RoomsListView/ListHeader/SearchBar.js

29 lines
633 B
JavaScript
Raw Normal View History

2019-04-17 18:57:46 +00:00
import React from 'react';
import PropTypes from 'prop-types';
import SearchBox from '../../../containers/SearchBox';
import { isIOS } from '../../../utils/deviceInfo';
2019-12-04 16:39:53 +00:00
import { withTheme } from '../../../theme';
2019-04-17 18:57:46 +00:00
2019-12-04 16:39:53 +00:00
const SearchBar = React.memo(({ theme, onChangeSearchText, inputRef }) => {
2019-04-17 18:57:46 +00:00
if (isIOS) {
2019-12-04 16:39:53 +00:00
return (
<SearchBox
onChangeText={onChangeSearchText}
testID='rooms-list-view-search'
inputRef={inputRef}
theme={theme}
/>
);
2019-04-17 18:57:46 +00:00
}
return null;
});
SearchBar.propTypes = {
2019-12-04 16:39:53 +00:00
theme: PropTypes.string,
2019-11-25 20:01:17 +00:00
inputRef: PropTypes.func,
2019-04-17 18:57:46 +00:00
onChangeSearchText: PropTypes.func
};
2019-12-04 16:39:53 +00:00
export default withTheme(SearchBar);