import React, { useState } from 'react'; import { Keyboard, StyleSheet, View } from 'react-native'; import ShareExtension from 'rn-extensions-share'; import SearchBox from '../../../containers/SearchBox'; import * as HeaderButton from '../../../containers/HeaderButton'; import { themes } from '../../../constants/colors'; import sharedStyles from '../../Styles'; import { animateNextTransition } from '../../../utils/layoutAnimation'; import { IShareListHeaderIos } from './interface'; const styles = StyleSheet.create({ container: { flexDirection: 'row', ...sharedStyles.separatorBottom } }); const Header = React.memo(({ searching, onChangeSearchText, initSearch, cancelSearch, theme }: IShareListHeaderIos) => { const [text, setText] = useState(''); const onChangeText = (searchText: string) => { onChangeSearchText(searchText); setText(searchText); }; const onCancelPress = () => { Keyboard.dismiss(); onChangeText(''); cancelSearch(); animateNextTransition(); }; const onFocus = () => { initSearch(); animateNextTransition(); }; return ( {!searching ? : null} ); }); export default Header;