fermeture auto + composant selectChantier
This commit is contained in:
@@ -20,6 +20,7 @@ import { ThemedTextInput } from "./themed-textinput";
|
||||
import { ThemedView } from "./themed-view";
|
||||
|
||||
const screenHeight = Dimensions.get("window").height;
|
||||
const { width, height } = Dimensions.get("window");
|
||||
|
||||
/*
|
||||
|
||||
@@ -80,12 +81,13 @@ export default function SelectChantier() {
|
||||
|
||||
return (
|
||||
<Animated.View layout={LinearTransition.duration(200)} style={isOpen ? styles.windowOpean : styles.windowClose}>
|
||||
{isOpen && (<Pressable style={styles.autoClose} onPress={() => setIsOpen(false)}/>)}
|
||||
<AnimatedThemedView layout={LinearTransition.duration(200)} lvl={2} shadow={true} style={styles.window}>
|
||||
<ThemedButton style={isOpen ? styles.buttonOpen : styles.buttonClose} lvl={isOpen ? 1 : 1} onPress={() => onPressOpen()}>
|
||||
<AnimatedThemedButton style={isOpen ? styles.buttonOpen : styles.buttonClose} lvl={isOpen ? 1 : 1} onPress={() => onPressOpen()}>
|
||||
<ThemedText style={styles.buttonText}>
|
||||
{isOpen ? "Fermer" : "Chantier"}
|
||||
{isOpen ? "Fermer" : (chantier!=null ? chantier.adresse : "Chantier")}
|
||||
</ThemedText>
|
||||
</ThemedButton>
|
||||
</AnimatedThemedButton>
|
||||
{isOpen && (
|
||||
<View style={styles.menu}>
|
||||
<ThemedTextInput lvl={1} border={4} style={styles.input} placeholder="Rechercher un chantier" value={search} onChangeText={setSearch}/>
|
||||
@@ -118,12 +120,22 @@ const styles = StyleSheet.create({
|
||||
width: "100%",
|
||||
height: screenHeight / 2,
|
||||
padding: 10,
|
||||
zIndex:1000,
|
||||
},
|
||||
window: {
|
||||
borderRadius: 15,
|
||||
height: "100%",
|
||||
//backgroundColor: '#00FF00',
|
||||
overflow: "hidden",
|
||||
},
|
||||
autoClose: {
|
||||
|
||||
position: 'absolute',
|
||||
top: -height,
|
||||
left: -width,
|
||||
width:width*2,
|
||||
height:height*2,
|
||||
//backgroundColor: 'rgba(255, 0, 0, 0.5)',
|
||||
},
|
||||
menu: {
|
||||
padding: 5,
|
||||
|
||||
Reference in New Issue
Block a user