import React, { useEffect, useState } from "react"; import { Dimensions, Platform, StyleSheet, TextInput, TouchableOpacity, View, } from "react-native"; import { heightPercentageToDP as hp, widthPercentageToDP as wp, } from "react-native-responsive-screen"; import strings from "res/strings"; import colors from "../../res/colors"; import { isLandscapeMode, isTablet, minIconSmall, minSubtitle2, minSubtitle3, } from "../utils/DimensionUtils"; import Icon from "react-native-vector-icons/FontAwesome"; interface Props { icon: string; placeholder: string; onChangeText: (text: string) => void; value: string; } const Input: React.FC = (props) => { const [textVisible, setTextVisible] = useState(false); const [isLandscape, setLandscape] = React.useState(null); useEffect(() => { Dimensions.addEventListener("change", onChange); return () => { Dimensions.removeEventListener("change", onChange); }; }); const onChange = () => { if (Dimensions.get("window").width < Dimensions.get("window").height) { setLandscape(false); } else { setLandscape(true); } }; return ( {textVisible && ( )} setTextVisible(!textVisible)} > ); }; export default Input; const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: colors.renderBGColor, justifyContent: "center", alignItems: "center", }, textStyle: { fontFamily: "Montserrat-Bold", fontSize: minSubtitle3(hp(2.5)), color: colors.home.white, paddingTop: hp(0.5), paddingBottom: hp(0.5), marginLeft: wp(3.75), textAlignVertical: "center", fontWeight: "500", }, iconStyle: { marginRight: wp(1.5), }, searchTextInput: { color: colors.home.white, //colors.darkText, height: Platform.OS === "android" ? 48 : 44, padding: 0, fontFamily: "Montserrat-Regular", }, });