fixed darkmode issues on login and home
This commit is contained in:
parent
f62b49b5cf
commit
8437f474aa
3 changed files with 33 additions and 10 deletions
|
|
@ -10,7 +10,8 @@ export default function SearchBar(props: SearchBarProps) {
|
|||
const [isActive, setIsactive] = React.useState(false);
|
||||
|
||||
const textColor = useThemeColor("interactiveText")
|
||||
const backgroundColor = useThemeColor("containerColor");
|
||||
const backgroundColor = useThemeColor("elementDefaultColor");
|
||||
|
||||
const handleChange = (text:string) : void => {
|
||||
if(text !== ""){
|
||||
if(!isActive){
|
||||
|
|
@ -23,9 +24,16 @@ export default function SearchBar(props: SearchBarProps) {
|
|||
}
|
||||
}
|
||||
|
||||
//TODO: Handle textCancel
|
||||
// cant apply the background color otherwise
|
||||
const containerStyle = {
|
||||
...styles.container,
|
||||
backgroundColor: backgroundColor // apply dynamic background color
|
||||
};
|
||||
|
||||
//TODO: Handle textCancel
|
||||
// changed styles.container to containerStyle
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<View style={containerStyle}>
|
||||
<TextInput onChangeText = {handleChange} style={[{fontSize: SIZES.normal, height: "100%"}, styles.TextInput]} autoCorrect={false} keyboardType='web-search' placeholder={props.placeholder}></TextInput>
|
||||
|
||||
{isActive &&
|
||||
|
|
@ -45,7 +53,6 @@ const styles = StyleSheet.create({
|
|||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
height: 40,
|
||||
backgroundColor: backgroundColor,
|
||||
borderRadius: 10,
|
||||
paddingHorizontal: 10
|
||||
},
|
||||
|
|
|
|||
Reference in a new issue