// @flow import * as React from "react"; import {Header} from "native-base"; import {Platform, StyleSheet} from "react-native"; import {getStatusBarHeight} from "react-native-status-bar-height"; import Touchable from 'react-native-platform-touchable'; import ThemeManager from "../utils/ThemeManager"; import CustomMaterialIcon from "./CustomMaterialIcon"; import {TextInput} from "react-native-paper"; import i18n from "i18n-js"; type Props = { navigation: Object, searchFunction: Function }; type State = { searchString: string } /** * Custom component defining a search header using native base */ export default class SearchHeader extends React.Component { state = { searchString: "Test", }; render() { /* TODO: - hard coded color (not theme-specific), - bugs with placeHolder and underlineColorAndroid (do not work), - subtle offset of the text to fix in the inputText - not tested on iOS */ return (
this.props.navigation.goBack()}> this.setState({searchString: text})} onSubmitEditing={text => { this.setState({searchString: text}); this.props.searchFunction(this.state.searchString); }} /> this.props.searchFunction(this.state.searchString)}>
); } }; // Fix header in status bar on Android const styles = StyleSheet.create({ header: { paddingTop: getStatusBarHeight(), height: 54 + getStatusBarHeight(), }, });