fixing cards filter

This commit is contained in:
Roland Osborne 2023-10-06 16:07:42 -07:00
parent fec1f9e2cf
commit 8d7e88d12b
2 changed files with 26 additions and 23 deletions

View File

@ -28,7 +28,7 @@ export function Cards({ navigation, openContact, openRegistry, addChannel }) {
)}
<View style={styles.inputwrapper}>
<AntIcons style={styles.icon} name="search1" size={16} color={Colors.inputPlaceholder} />
<TextInput placeholder={ state.strings.contactFilter } placeholderTextColor={Colors.inputPlaceholder} value={state.filter}
<TextInput placeholder={ state.strings.contactFilter } placeholderTextColor={Colors.inputPlaceholder}
style={styles.inputfield} autoCapitalize={'none'} spellCheck={false} onChangeText={actions.setFilter} />
<View style={styles.space} />
</View>
@ -40,7 +40,7 @@ export function Cards({ navigation, openContact, openRegistry, addChannel }) {
),
});
}
}, [navigation]);
}, [navigation, state.sort]);
const call = async (contact) => {
try {
@ -57,6 +57,7 @@ export function Cards({ navigation, openContact, openRegistry, addChannel }) {
return (
<View style={styles.container}>
{ !navigation && (
<View style={styles.title}>
{ state.sort && (
<TouchableOpacity style={styles.sort} onPress={() => actions.setSort(false)}>
@ -79,7 +80,7 @@ export function Cards({ navigation, openContact, openRegistry, addChannel }) {
<Text style={styles.newtext}>{ state.strings.add }</Text>
</TouchableOpacity>
</View>
)}
{ state.cards.length == 0 && (
<View style={styles.notfound}>
<Text style={styles.notfoundtext}>{ state.strings.noContacts }</Text>

View File

@ -111,6 +111,8 @@ export function useCards() {
updateState({ filter });
},
setSort: (sort) => {
console.log("SETTTING : ", sort);
updateState({ sort });
},
};