mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
fixing cards filter
This commit is contained in:
parent
fec1f9e2cf
commit
8d7e88d12b
@ -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,29 +57,30 @@ export function Cards({ navigation, openContact, openRegistry, addChannel }) {
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<View style={styles.title}>
|
||||
{ state.sort && (
|
||||
<TouchableOpacity style={styles.sort} onPress={() => actions.setSort(false)}>
|
||||
<MatIcons style={styles.icon} name="sort-ascending" size={24} color={Colors.text} />
|
||||
{ !navigation && (
|
||||
<View style={styles.title}>
|
||||
{ state.sort && (
|
||||
<TouchableOpacity style={styles.sort} onPress={() => actions.setSort(false)}>
|
||||
<MatIcons style={styles.icon} name="sort-ascending" size={24} color={Colors.text} />
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
{ !state.sort && (
|
||||
<TouchableOpacity style={styles.sort} onPress={() => actions.setSort(true)}>
|
||||
<MatIcons style={styles.icon} name="sort-ascending" size={24} color={Colors.unsetText} />
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
<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}
|
||||
style={styles.inputfield} autoCapitalize={'none'} spellCheck={false} onChangeText={actions.setFilter} />
|
||||
<View style={styles.space} />
|
||||
</View>
|
||||
<TouchableOpacity style={styles.add} onPress={() => openRegistry(navigation)}>
|
||||
<AntIcons name={'adduser'} size={16} color={Colors.primaryButtonText} style={[styles.box, { transform: [ { rotateY: "180deg" }, ]} ]}/>
|
||||
<Text style={styles.newtext}>{ state.strings.add }</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
{ !state.sort && (
|
||||
<TouchableOpacity style={styles.sort} onPress={() => actions.setSort(true)}>
|
||||
<MatIcons style={styles.icon} name="sort-ascending" size={24} color={Colors.unsetText} />
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
<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}
|
||||
style={styles.inputfield} autoCapitalize={'none'} spellCheck={false} onChangeText={actions.setFilter} />
|
||||
<View style={styles.space} />
|
||||
</View>
|
||||
<TouchableOpacity style={styles.add} onPress={() => openRegistry(navigation)}>
|
||||
<AntIcons name={'adduser'} size={16} color={Colors.primaryButtonText} style={[styles.box, { transform: [ { rotateY: "180deg" }, ]} ]}/>
|
||||
<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>
|
||||
|
@ -111,6 +111,8 @@ export function useCards() {
|
||||
updateState({ filter });
|
||||
},
|
||||
setSort: (sort) => {
|
||||
console.log("SETTTING : ", sort);
|
||||
|
||||
updateState({ sort });
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user