mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
setting card active state in drawer view
This commit is contained in:
parent
8848152a5d
commit
8515558ac6
@ -177,6 +177,9 @@ export function Session() {
|
|||||||
const openCards = () => {
|
const openCards = () => {
|
||||||
cardNav.openDrawer();
|
cardNav.openDrawer();
|
||||||
}
|
}
|
||||||
|
const isCardOpen = () => {
|
||||||
|
return cardNav.getState().history.length > 1;
|
||||||
|
}
|
||||||
|
|
||||||
const conversation = useContext(ConversationContext);
|
const conversation = useContext(ConversationContext);
|
||||||
|
|
||||||
@ -202,7 +205,7 @@ export function Session() {
|
|||||||
<Text style={styles.profileLabel}>Profile</Text>
|
<Text style={styles.profileLabel}>Profile</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<TouchableOpacity style={styles.option} onPress={openCards}>
|
<TouchableOpacity style={styles.option} onPress={openCards}>
|
||||||
<CardsIcon color={Colors.text} size={20} />
|
<CardsIcon color={Colors.text} size={20} active={isCardOpen()} />
|
||||||
<Text style={styles.profileLabel}>Contacts</Text>
|
<Text style={styles.profileLabel}>Contacts</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
|
Loading…
Reference in New Issue
Block a user