changed name of SearchBar to TextInputBar

This commit is contained in:
Jakob Stornig 2024-01-04 21:47:10 +01:00
parent 5876fcaf8e
commit e1efed5b21
2 changed files with 8 additions and 6 deletions

View file

@ -9,7 +9,7 @@ interface SearchBarProps extends ViewProps {
onChangeText? : (text: string) => void | undefined onChangeText? : (text: string) => void | undefined
} }
export default function SearchBar(props: SearchBarProps) { export default function TextInputBar(props: SearchBarProps) {
const [isActive, setIsactive] = React.useState(false); const [isActive, setIsactive] = React.useState(false);
const { colors } = useTheme(); const { colors } = useTheme();
const [text, setText] = useState<string>(""); const [text, setText] = useState<string>("");
@ -43,7 +43,7 @@ export default function SearchBar(props: SearchBarProps) {
// changed styles.container to containerStyle // changed styles.container to containerStyle
return ( return (
<View style={containerStyle}> <View style={containerStyle}>
<TextInput onChangeText = {handleChange} style={[{fontSize: SIZES.normal, height: "100%"}, styles.TextInput]} autoCorrect={false} keyboardType='web-search' placeholder={props.placeholder} value={text}/> <TextInput onChangeText = {handleChange} style={[{fontSize: SIZES.normal, height: "100%"}, styles.TextInput]} autoCorrect={false} keyboardType='default' placeholder={props.placeholder} value={text}/>
{isActive && {isActive &&
<TouchableOpacity style={styles.cancel} onPress={()=>{handleChange("")}}> <TouchableOpacity style={styles.cancel} onPress={()=>{handleChange("")}}>

View file

@ -5,11 +5,13 @@ import ExpenseItem from "./home/expenseItem"
//common //common
import CustomCard from "./common/CustomCard" import CustomCard from "./common/CustomCard"
import SearchBar from "./common/SearchBar"
import NavigationButton from "./common/button" import NavigationButton from "./common/button"
import LoadingSymbol from "./common/loadingSymbol" import LoadingSymbol from "./common/loadingSymbol"
import Plus from "./common/plus" import Plus from "./common/plus"
import TextInputBar from "./common/TextInputBar"
import AutoDecimalInput from "./common/AutoDecimalInput" import AutoDecimalInput from "./common/AutoDecimalInput"
import CategorySelector from "./common/CategorySelector"
import CategorySelectorModal from "./common/CategorySelectorModal"
//login //login
import BudgetHeader from "./budget/budgetHeader" import BudgetHeader from "./budget/budgetHeader"
@ -21,8 +23,8 @@ import TypeSelectorSwitch from "./budget/typeSelectorSwitch"
import Input from "./login/input" import Input from "./login/input"
export { export {
BudgetHeader, ButtonSetting, CategoryItem, CustomCard, CustomColorPicker, ExpenseItem, Input, BudgetHeader, ButtonSetting, CustomCard, ExpenseItem, Input,
LoadingSymbol, NavigationButton, Plus, LoadingSymbol, Plus,
SearchBar, ToggleSetting, TypeSelectorSwitch, Welcome, AutoDecimalInput TextInputBar, ToggleSetting, Welcome, AutoDecimalInput
} }