import React, { useState } from "react"; import { TextInput, View, StyleSheet, Pressable } from "react-native"; import { connect } from "react-redux"; import tw from "tailwind-rn"; import { AntDesign } from "@expo/vector-icons"; //style import Colors from "../constants/Colors"; import fontSize from "../constants/fontSize"; const Search = ({ placeholder, textAlign, direction, onChange, value, theme, }) => { const styles = StyleSheet.create({ inputStyle: { fontSize: fontSize.tiny, color: Colors.theme1[theme].gray2077, borderWidth: 0.5, borderColor: Colors.theme1[theme].gray20 + "88", paddingVertical: 10, paddingHorizontal: 10, direction: direction, textAlign: textAlign, backgroundColor: Colors.theme1[theme].white, fontFamily: "regular", }, }); return ( onChange(text)} placeholder={placeholder} placeholderTextColor={Colors.theme1[theme].gray20 + '88'} value={value} /> ); }; const mapStateToProps = (state) => ({ theme: state.publicApi.theme, }); export default connect(mapStateToProps)(Search); Search.defaultProps = { direction: "rtl", textAlign: "right", };